Skip to content
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

jj resolve should handle rename+edit conflicts nicely #1112

Open
dbarnett opened this issue Jan 23, 2023 · 0 comments
Open

jj resolve should handle rename+edit conflicts nicely #1112

dbarnett opened this issue Jan 23, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@dbarnett
Copy link
Collaborator

Description

When merging one revision that moves (or copies) a file and another that makes changes in the original file, the jj resolve command should offer more help in diffing the right files and getting all the changes integrated where they belong.

This also entails jj tracking some notion of tracking file move/copies (#47). Although the git backend might have some rename detection of its own?

Expected Behavior

Trivial scenario

  • Rev 1 just renames a.txt to b.txt
  • Rev 2 edits a.txt
  • Merge commit 1+2 should contain b.txt with the contents of rev 2's a.txt (ideally handled fully automatically)

Rename-edit + edit scenario

  • Rev 1 renames a.txt to b.txt and makes edits
  • Rev 2 edits a.txt
  • Merge commit 1+2 should contain b.txt and prompt to resolve conflicts, showing a diff between rev 1's b.txt and rev 2's a.txt

Copy-edit + edit scenario

  • Rev 1 copies a.txt to b.txt and makes edits in both
  • Rev 2 edits a.txt
  • Merge commit 1+2 should contain both a.txt and b.txt and prompt to resolve conflicts between both of the following pairs (because rev 2's edits might ultimately belong in a.txt or b.txt, or both):
    • rev 1's a.txt and rev 2's a.txt
    • rev 1's b.txt and rev 2's a.txt

In some cases it might already be unambiguous whether rev 2's edits belong in a.txt or b.txt and not need to resolve against both. For instance, if rev 1 had forked the contents of a.txt into 2 files, keeping lines 1-50 in a.txt and moving lines 51-100 into b.txt, then it might be self-evident how to properly incorporate other edits into one destination file or the other.

@dbarnett dbarnett added the enhancement New feature or request label Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant