Git conflict resolution helpers
Is your feature request related to a problem? Please describe.
When a Git branch is getting formatted, it can cause merge conflicts for other branches. These merge conflicts can in theory be resolved automatically, but that's currently not easily possible.
Describe the solution you'd like
Ideally both of:
- A CLI command for a
git mergetool-compatible mode, implemented like https://github.com/NixOS/nixfmt/pull/277 (alse has some docs). This is a quick way to resolve merge conflicts, but there's a chance for invalid results. - A CLI command to auto-rebase like the one in Nixpkgs, based on
git filter-branch. This is a bit more limited, clunkier and slower, but it can't produce invalid results.
These are orthogonal and useful in their own ways.
Describe alternatives you've considered
Implementing it outside treefmt, as linked above. But this doesn't seem ideal because this functionality is generic over formatters, so treefmt would be the ideal place to implement it.
Additional context
At a first glance, it looks like the mergetool compatible mode would be pretty cool. Need to wrap my head around it a bit more and the clunkier approach.