jj icon indicating copy to clipboard operation
jj copied to clipboard

Add a `jj interdiff` command

Open martinvonz opened this issue 4 years ago • 3 comments

It should be very easy to implement a command that shows the diff between two commits after rebasing the first command to the second commit's parent(s). This would be useful as part of jj obslog -p/--diff output (that command doesn't accept such a flag yet). (Mercurial's hg obslog -p currently gives up when a commit has been rebased.)

martinvonz avatar Aug 18 '21 17:08 martinvonz

I currently use a lot of diff -u <(git show commit1) <(git show commit2) to compare rebased commits before deleting the original branch (in trickier cases when I suspect changes may have creeped in unintentionally). Is this the kind of comparison that jj interdiff is meant to support?

waldyrious avatar Apr 09 '22 18:04 waldyrious

Yes, jj interdiff is meant for the same use case. I think I could implement it in less than 10 minutes (excluding tests and polish). I've left it the backlog because I don't need it often and it seems like a good way for a new contributor to get used to the code base, and to show off how easy it is to implement something like this :) Let me know if you're interested in trying to implement it.

PS. When using git, you may want to try interdiff <(git show commit1) <(git show commit2) or (with somewhat recent git versions) git range-diff commit1^..commit1 commit2^..commit2.

martinvonz avatar Apr 09 '22 22:04 martinvonz

Let me know if you're interested in trying to implement it.

Thanks for the offer, but I am already stretched quite thin across various projects. I don't foresee having the bandwidth to take this on anytime soon, unfortunately.

PS. When using git, you may want to try interdiff

I appreciate the suggestion — I actually was not aware of that stand-alone command :)

waldyrious avatar Apr 10 '22 17:04 waldyrious