Sorry! As I've recommended to others, I suggest merging origin/main into your local feature branch using the "ours" strategy, and then applying spotlessApply to get into a consistent formatted state.
Sample workflow:
Bash:
git fetch origin
git merge --strategy=ours origin main
./gradlew spotlessApply
git add src/ test/
git commit -m "Apply formatting to local patches in main"
git switch featureBranch
git merge --strategy=ours main
...
(You can also combine the first two steps via `git pull -s ours origin main` if you want.)
If you're keeping track of these via git stash rather than explicit commits in a local repository, then you'll want to use something like `git cherry-pick -n -m1 -X theirs stash` (
sample stackoverflow post). Note that I've changed the strategy to "theirs" because once you've pulled in the mainline changes, `stash` is the foreign reference you're merging from.
Moving forward, now that we're using a consistent, tool-enforced formatting style, this should not happen again. I made the judgment call that I'd rather break all these non-mainline commits at once, rather than gradually ratcheting style changes and taking on significant review burden and adding cognitive load for the reader when working in an inconsistent codebase.
And, depending on the nature of your customization patches, I'd be happy to look into them to see which make sense to adopt as part of the mainline branch of Mafia itself, so you can drop the patches entirely.