-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve: try to resolve all conflicted files in fileset #5111
base: main
Are you sure you want to change the base?
Conversation
I recently learned that some commands support filesets. Is |
We actually already support filsets in this command. It's just that the command would always stop after the first conflict before this PR (so even |
Yes, it already does support filesets, and the default is Edit: nevermind, looks like @martinvonz already responded! |
Is this because existing merge editor work on a single file at a time, so we have no choice but to resolve conflicts individually? (Is there a warning in the case that subsequent conflicts are ignored?) For uniformity, should we have an
|
If we want the default behavior of picking a single file to be expressable with filesets, then we'd probably want a TBH, I'm not sure I've ever actually wanted the default behavior of only resolving a single, seemingly-random file though. Usually, I want to resolve every conflict, or I want to resolve a conflict in a specific file I specify. So maybe we could just change |
29cfe83
to
11fc840
Compare
Makes sense to me, although implementing that is its whole own matter.
In both your workflow and my workflow, it sounds like resolving a single arbitrary file is probably not desirable:
|
I think in practice, this shouldn't be an issue because we treat an unmodified or blank output file as an error, so it would stop launching more editors if someone closes the editor without making any changes. That being said, it does feel a bit strange to launch the editor multiple times without the user requesting it explicitly, so it might be nice to not launch multiple editors by default anyway. At some point, I'm thinking that we probably will want to support merge tools which can merge whole directories at once instead of being invoked with each file individually. |
I'm also for that. |
Oh, @ilyagr might also have thoughts. He wrote most of the current implementation. |
11fc840
to
69c8240
Compare
--all
optionI'm going to change the merge tools to accept multiple files, and this will make it easier to pass all the required data about each file.
If many files are conflicted, it would be nice to be able to resolve all conflicts at once without having to run `jj resolve` multiple times. This is especially nice for merge tools which try to automatically resolve conflicts without user input, but it is also good for regular merge editors like VS Code. This change makes the behavior of `jj resolve` more consistent with other commands which accept filesets since it will use the entire fileset instead of picking an arbitrary file from the fileset. Since we don't support passing directories to merge tools yet, the current implementation just calls the merge tool repeatedly in a loop until every file is resolved, or until an error occurs. If an error occurs after successfully resolving at least one file, it is downgraded to a warning instead. This means the user can just close the editor at any point to cancel resolution on all remaining files.
69c8240
to
dbbe3df
Compare
If many files are conflicted, it would be nice to be able to resolve all conflicts at once without having to run
jj resolve
multiple times. This is especially nice for merge tools which try to automatically resolve conflicts without user input, but it can also be used for regular merge editors like VS Code.Checklist
If applicable:
CHANGELOG.md