What do I do with divergent change-IDs? #2485
-
I generally keep my merge commits separate from any other commits. I merged I hadn't noticed the "accidentally amended the working copy" advice in the FAQ, and I happened to push to my remote immediately after merging, so I attempted to resolve the issue by rebasing the modified commit onto the pushed commit:
Is there a way to forcibly assign a new change-ID to one or the other of these? It may not matter, since it seems I can use the commit IDs for all the operations I'd want, but it feels like a strange state to be stuck in. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The "default" way to keep one of the different commits is to `jj
duplicate` it.
…On Tue, Oct 31, 2023, 2:01 PM Kyle J Strand ***@***.***> wrote:
I generally keep my merge commits separate from any other commits. I
merged trunk into a feature-branch, then made some changes without jj new.
I only later realized that my working copy was still set to the merge
commit, so I was editing that.
I hadn't noticed the "accidentally amended the working copy" advice in the
FAQ, and I happened to push to my remote immediately after merging, so I
attempted to resolve the issue by rebasing the modified commit onto the
pushed commit: jj rebase -r <merge+modifications> -d ***@***.*** Of
course, these shared the same change-ID. So now my change-ID is divergent:
◉ omwkzvop?? ***@***.*** 2023-10-31 14:51:41.000 -06:00 <branch> ***@***.*** 8824d66d
│ <description of post-merge changes>
◉ omwkzvop?? ***@***.*** 2023-10-31 13:32:06.000 -06:00 411fd733
├─╮ (empty) Merge '<trunk>' into '<branch>'
...
Is there a way to forcibly assign a new change-ID to one or the other of
these? It may not matter, since it seems I can use the commit IDs for all
the operations I'd want, but it feels like a strange state to be stuck in.
—
Reply to this email directly, view it on GitHub
<#2485>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7OTJZBKZKGN2EXJGV7OP3YCFRLFAVCNFSM6AAAAAA6YKTJEOVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZVG44TSMZTGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
As Ilya said, you can use Incidentally, the pending PR #2477 adds an FAQ entry about this. We also have #555 about warning immediately when the divergence happens. |
Beta Was this translation helpful? Give feedback.
As Ilya said, you can use
jj duplicate
to fix it. That will create a new commit with a different change id. You can then abandon the old commit (8824d66d
in your case).Incidentally, the pending PR #2477 adds an FAQ entry about this. We also have #555 about warning immediately when the divergence happens.