Help with consistent conflicts with Gerrit /git colocated and jiri #8037
Replies: 1 comment 2 replies
-
|
When git rebases, it calculates a patch ID for each commit so it can determine whether that patch has been previously applied. I think that's what makes this Just Work with git and what it means when it outputs "skipped previously applied commit abc". jj doesn't currently have this kind of mechanism, so if you rebase Hopefully jj gains a similar feature, but in the meantime, one option is to use git to do the rebase. If you don't have a bookmark name already in the right place, it can be a little cumbersome: $ jj bookmark set foo -r B
$ git switch foo
$ git rebase JHEAD
$ jj bookmark delete fooThe reason for the bookmark is so jj sees that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I recently switched to
jjand I keep hitting this papercut I could use help with. My flow typically consists of pushing a stack of changes to gerrit, which then get rolled one by one as checks pass. So the commits that I push get rewritten on top of the main branch as part of the commit queue.To get new changes from upstream I run
where
setjhead.shis just a that parsesJIRI_HEAD(roughly always the same asmain@origin) and sets the bookmarkJHEADto it:Anyway, what always ends up happening is: I have two changes that I pushed
AandBand they get merged into the main branch. They touch roughly the same lines. After updating the tree withjiri updateabove, I try to rebase all my changes withBefore updating my tree looks like:
JHEAD - A - B.After updating I end up with:
x - A - B,x ~ A' ~ B' ~ JHEADwherexwas my previous bookmark forJHEAD,A'andB'are the submitted version ofAandBthat I have locally. Then I try the rebase command. I would like for it to see thatAandBhave both been merged upstream so they get emptied and abandoned (coming fromgit-branchlessthat's what I got for free). But now what I consistently get is thatArebased onJHEADcauses conflicts because it's trying to be applied on top ofB'.I end up manually abandoning these changes every time this happens, but it'd be really great if it Just Worked(™). I can't tell if this is WAI or if there's something wrong with the way I'm updating the tree or rebasing that keeps causing this.
Beta Was this translation helpful? Give feedback.
All reactions