Thanks,
Pat
On Monday, October 20, 2025 at 8:11:56 AM UTC+2 Sven Selberg wrote:On Sunday, October 19, 2025 at 1:05:40 PM UTC+2 Pat Maddox wrote:Hi there, I've been using gerrit for my personal code review before submitting patches to upstream projects, and it's excellent. I wish I had come across this tool years ago.
The upstream projects do not accept the change-id trailer. I'm able to strip it out with scripts before submitting, so that's not an issue. I'm finding that when I rebase my local branch off of upstream, jujutsu does what it's supposed to - removes all of the empty commits that are now present in the branch - but pushing the newly updated branch to gerrit has no effect on the changes. If the commits had the change-id trailer, it would mark them as merged, but it doesn't.
Right now I manually go through each of the commits and abandon them with a comment "merged upstream." However I'm hoping there's a way that gerrit can recognize the commits, and mark them as merged.
Git has the notion of "patch id" which hashes the diff content, irrespective of commit metadata including parent. This is what `git cherry` uses to determine if a commit is present in multiple branches. `git show <commit> | git patch-id` will calculate this.
Does Gerrit have a way to detect that a change has been merged upstream, even though the change-id has been removed?No, the Change-Id footer is the way that Gerrit determines if a commit is part of a change or not (combined with $PROJECT and $BRANCH).
The patch-id identification wouldn't work for Gerrit as two patchsets may contain completely different diffs.Sven, git patch-id != Gerrit patchId, they are two different concepts. The git patch-id represents the diff.Although Gerrit only uses the Change-Id currently for this, I think the project would likely be open to changes which would index the git patch-id to do what you propose. It would mean potentially doing a lot more work on pushes, which could be expensive, so care would need to be taken here (make it configurable/optional...),-Martin
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/33d5d344-a837-4ec7-8241-c24db395fa9dn%40googlegroups.com.
On Wed, Oct 22, 2025 at 9:17 AM 'mfick' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:On Monday, October 20, 2025 at 8:11:56 AM UTC+2 Sven Selberg wrote:On Sunday, October 19, 2025 at 1:05:40 PM UTC+2 Pat Maddox wrote:Hi there, I've been using gerrit for my personal code review before submitting patches to upstream projects, and it's excellent. I wish I had come across this tool years ago.
The upstream projects do not accept the change-id trailer. I'm able to strip it out with scripts before submitting, so that's not an issue. I'm finding that when I rebase my local branch off of upstream, jujutsu does what it's supposed to - removes all of the empty commits that are now present in the branch - but pushing the newly updated branch to gerrit has no effect on the changes. If the commits had the change-id trailer, it would mark them as merged, but it doesn't.What you're missing is the implementation of this accepted Gerrit design to support Jujutsu's (and GitButler's) way of using a change-id in the commit object header.When that's added to Gerrit (no timeline AFAIK, not sure if anyone has started work on it yet), you won't need the trailer line at all and the change-id from the commit object header will be used instead. There was also discussion at Git Merge around git itself having more direct support for change-ids in commit object headers (not removing them during rebase, etc).Nasser
On Wednesday, October 22, 2025 at 8:52:04 AM UTC-7 Nasser Grainawi wrote:On Wed, Oct 22, 2025 at 9:17 AM 'mfick' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:On Monday, October 20, 2025 at 8:11:56 AM UTC+2 Sven Selberg wrote:On Sunday, October 19, 2025 at 1:05:40 PM UTC+2 Pat Maddox wrote:Hi there, I've been using gerrit for my personal code review before submitting patches to upstream projects, and it's excellent. I wish I had come across this tool years ago.
The upstream projects do not accept the change-id trailer. I'm able to strip it out with scripts before submitting, so that's not an issue. I'm finding that when I rebase my local branch off of upstream, jujutsu does what it's supposed to - removes all of the empty commits that are now present in the branch - but pushing the newly updated branch to gerrit has no effect on the changes. If the commits had the change-id trailer, it would mark them as merged, but it doesn't.What you're missing is the implementation of this accepted Gerrit design to support Jujutsu's (and GitButler's) way of using a change-id in the commit object header.When that's added to Gerrit (no timeline AFAIK, not sure if anyone has started work on it yet), you won't need the trailer line at all and the change-id from the commit object header will be used instead. There was also discussion at Git Merge around git itself having more direct support for change-ids in commit object headers (not removing them during rebase, etc).NasserThanks for that. I read through it, and it's not clear to me that it addresses the scenario I'm talking about. Here's a more detailed example:1. I write a patch for freebsd-ports and upload a change to gerrit.2. I use `git format-patch` to send the patch upstream (stripping out change-id trailer)3. A committer reviews and commits it4. `git pull --rebase` gets the new commit5. I push to gerritWhat I'd _like_ to happen is for gerrit to see that the change is now merged. The diff is exactly the same as what I uploaded - it's simply the metadata (committer name / email, sometimes commit message) that is different from what gerrit knows about. Same diff, different commit.
The review looks like it would require jujutsu. The workflow that I shared above is pretty common in open source, and should not depend on jujutsu at all. That design doc appears to be focused entirely on tracking the change id - when what I'm pointing out is that git already provides enough info to determine that a change has been merged.
From what I can tell, that design doc requires:1. I be using jujutsu2. I git fetch on the same machine I used to create the patch3. jujutsu notices that the upstream branch has the same change, and (I guess) migrates the change id from the original commit to the new one?4. I be the person to push the updated branch to gerritIn reality, it could work more like:1. I submit a change2. Someone else commits it3. A third person, using git, pushes the updated main branch to a shared gerrit instanceI believe git provides all the info needed to track that already, and that it would be useful if gerrit did so.Pat
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/108ac369-860c-4a04-9178-9293f00a8fafn%40googlegroups.com.
On Monday, October 20, 2025 at 8:11:56 AM UTC+2 Sven Selberg wrote:On Sunday, October 19, 2025 at 1:05:40 PM UTC+2 Pat Maddox wrote:Hi there, I've been using gerrit for my personal code review before submitting patches to upstream projects, and it's excellent. I wish I had come across this tool years ago.
The upstream projects do not accept the change-id trailer. I'm able to strip it out with scripts before submitting, so that's not an issue. I'm finding that when I rebase my local branch off of upstream, jujutsu does what it's supposed to - removes all of the empty commits that are now present in the branch - but pushing the newly updated branch to gerrit has no effect on the changes. If the commits had the change-id trailer, it would mark them as merged, but it doesn't.
Right now I manually go through each of the commits and abandon them with a comment "merged upstream." However I'm hoping there's a way that gerrit can recognize the commits, and mark them as merged.
Git has the notion of "patch id" which hashes the diff content, irrespective of commit metadata including parent. This is what `git cherry` uses to determine if a commit is present in multiple branches. `git show <commit> | git patch-id` will calculate this.
Does Gerrit have a way to detect that a change has been merged upstream, even though the change-id has been removed?No, the Change-Id footer is the way that Gerrit determines if a commit is part of a change or not (combined with $PROJECT and $BRANCH).
The patch-id identification wouldn't work for Gerrit as two patchsets may contain completely different diffs.Sven, git patch-id != Gerrit patchId, they are two different concepts. The git patch-id represents the diff.
Although Gerrit only uses the Change-Id currently for this, I think the project would likely be open to changes which would index the git patch-id to do what you propose. It would mean potentially doing a lot more work on pushes, which could be expensive, so care would need to be taken here (make it configurable/optional...),
-Martin
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/4E046D05-DA99-4C6A-AA08-B03ED9E220A4%40gmail.com.
+1, it would be nice if also GitButler could agree on the same header, as its workflow is very nicely integrated with Gerrit [1].
Edwin summarized the discussion with jj in this design doc:
-Martin
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/816d41bb-4efe-4113-be61-97f779dcd5dcn%40googlegroups.com.
On 23 Oct 2025, at 18:09, 'mfick' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:On Thursday, October 23, 2025 at 9:19:05 AM UTC+2 Matthias Sohn wrote:+1, it would be nice if also GitButler could agree on the same header, as its workflow is very nicely integrated with Gerrit [1].I believe this was already done.
Edwin summarized the discussion with jj in this design doc:The primary links in that doc results in "NOT FOUND" for me,-Martin
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/816d41bb-4efe-4113-be61-97f779dcd5dcn%40googlegroups.com.
-Martin
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/816d41bb-4efe-4113-be61-97f779dcd5dcn%40googlegroups.com.
Pat