-
Notifications
You must be signed in to change notification settings - Fork 321
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
Add a jj absorb
command
#170
Comments
I think the superior cases are covered by the tests. If you can port the tests then it's easier to see the differences. Basically weave should behave better when adjacent/context lines are changed. |
I can confirm that. Here's a commit created by
The number on each line is the commit it was added in (e.g. "c3" was added in commit 3, replacing the previous "c*" line). The lines ending in "5" were added in the index. As you can see, all the fixup would move all the edits in the fourth commit instead of spreading the changes out over commits 1-4. It makes sense when you think about how it works, of course. Thanks for explaining. |
While not automatic like
I still think we should have a |
For anyone who sorely misses this feature, as a workaround you can install git-absorb and just run "git absorb", then continue using JJ for everything else. It doesn't play well when going branchless though unfortunately :( |
Some Discord discussions: Many people express their interest in I had some vague ideas about |
I mentioned this on Discord before (TODO: check if it's the above links or more), or maybe in previous discussions, but not here. I'm still a bit excited about using the conflict resolution machinery for this and/or (maybe) for Given
we already have machinery that will tell you what becomes conflicted when you rebase If X is already conflicted (or, more interestingly, if X is conflicted and A is not), we'd look at whether rebasing makes the conflict worse. This might not work as well as weaves right now, but then there's a chance that we could improve I still need to think about whether this directly applies to having a blame layer. |
The destination commits are selected based on annotation, which I think is basically the same as "hg absorb" (except for handling of consecutive hunks.) However, we don't compute a full interleaved delta right now, and the hunks are merged in the same way as "jj squash". This means absorbed hunks might produce conflicts if no context lines exist. Still I think this is more intuitive than selecting destination commits based on patch commutativity. I've left inline comments to the tests where behavior is different from "hg absorb", but these aren't exhaustively checked. Closes martinvonz#170
The destination commits are selected based on annotation, which I think is basically the same as "hg absorb" (except for handling of consecutive hunks.) However, we don't compute a full interleaved delta right now, and the hunks are merged in the same way as "jj squash". This means absorbed hunks might produce conflicts if no context lines exist. Still I think this is more intuitive than selecting destination commits based on patch commutativity. I've left inline comments to the tests where behavior is different from "hg absorb", but these aren't exhaustively checked. Closes martinvonz#170
The destination commits are selected based on annotation, which I think is basically the same as "hg absorb" (except for handling of consecutive hunks.) However, we don't compute a full interleaved delta right now, and the hunks are merged in the same way as "jj squash". This means absorbed hunks might produce conflicts if no context lines exist. Still I think this is more intuitive than selecting destination commits based on patch commutativity. I've left inline comments to the tests where behavior is different from "hg absorb", but these aren't exhaustively checked. Closes martinvonz#170
The destination commits are selected based on annotation, which I think is basically the same as "hg absorb" (except for handling of consecutive hunks.) However, we don't compute a full interleaved delta right now, and the hunks are merged in the same way as "jj squash". This means absorbed hunks might produce conflicts if no context lines exist. Still I think this is more intuitive than selecting destination commits based on patch commutativity. I've left inline comments to the tests where behavior is different from "hg absorb", but these aren't exhaustively checked. Closes martinvonz#170
The destination commits are selected based on annotation, which I think is basically the same as "hg absorb" (except for handling of consecutive hunks.) However, we don't compute a full interleaved delta right now, and the hunks are merged in the same way as "jj squash". This means absorbed hunks might produce conflicts if no context lines exist. Still I think this is more intuitive than selecting destination commits based on patch commutativity. I've left inline comments to the tests where behavior is different from "hg absorb", but these aren't exhaustively checked. Closes martinvonz#170
The destination commits are selected based on annotation, which I think is basically the same as "hg absorb" (except for handling of consecutive hunks.) However, we don't compute a full interleaved delta right now, and the hunks are merged in the same way as "jj squash". This means absorbed hunks might produce conflicts if no context lines exist. Still I think this is more intuitive than selecting destination commits based on patch commutativity. I've left inline comments to the tests where behavior is different from "hg absorb", but these aren't exhaustively checked. Closes martinvonz#170
Description
As suggested by @unrelentingtech in #64, we should have a
jj absorb
command. There'sgit absorb
, which was inspired byhg absorb
. The two are implemented quite differently. Mercurial's is based on weaves, while Git's is based on "commuting" diff hunks. @durin42 tells me weaves are superior. I'd like to understand better what the difference is in practice (i.e. some concrete examples and how they behave with each method). Maybe @quark-zju (the original author ofhg absorb
) also has some thoughts.The text was updated successfully, but these errors were encountered: