Skip to content

Conversation

@godnight10061
Copy link
Contributor

@godnight10061 godnight10061 commented Jan 5, 2026

Fixes #10188

When pushing to Gerrit, if a commit was already pushed outside GitButler, Gerrit may reject with (no new changes). GitButler treats this as success, but the push output contains no change URLs, so no Gerrit metadata was recorded and the UI kept the commit as 'unpushed' / missing the CR link.

This adds a fallback in but-gerrit to derive the Gerrit host from the repo push remote and generate a review URL from the commit's GitButler change UUID (the same I<sha1(uuid)> Change-Id used in trailers), e.g. https://<gerrit-host>/q/<change-id>.

Tests

  • cargo test -p but-gerrit

When a commit was already pushed to Gerrit outside GitButler, a later
push from GitButler gets remote rejected '(no new changes)'.
GitButler treats this as success but no metadata was stored, so the
commit stayed 'unpushed'.

This change adds a fallback to generate a Gerrit review URL from the
Gerrit host (derived from git remote URL) and the Gerrit Change-Id
computed from GitButler change UUID.

Includes an integration test verifying the fallback.
@vercel
Copy link

vercel bot commented Jan 5, 2026

@godnight10061 is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the rust Pull requests that update Rust code label Jan 5, 2026
Copy link
Collaborator

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for contributing, it's much appreciated!

And while I would have a thing or two to say about the test (which I would probably just refactor myself), I lack experience with Gerrit to understand the problem the PR is solving in the first place.

Maybe @krlvi could see if this pans out (and maybe even try it) beforehand. Alternatively, and independently, maybe @godnight10061 could make a before and after video to show how the fix translates to the real world?

Thanks again.

@Byron Byron added the feedback requested Feedback was requested to help resolve the issue label Jan 6, 2026
@godnight10061
Copy link
Contributor Author

Maybe @krlvi could see if this pans out (and maybe even try it) beforehand. Alternatively, and independently, maybe @godnight10061 could make a before and after video to show how the fix translates to the real world?

Thanks again.

before.mp4
after.mp4

How to reproduce:

  • In GitButler: Project Settings → General → “Gerrit Configuration” → toggle ON.
  • In GitButler: make a tiny change and create a commit in GitButler (so it has a GitButler change id).
    • Before (bug): push “succeeds”, but the commit still shows Local (circle) and Push stays enabled (still thinks
      there are unpushed commits).
    • After (fixed): commit flips to Local and remote (diamond) and Push disables (“No commits to push”).
      (Depending on URL format you may or may not also see a Gerrit pill/link.)
image

Copy link
Member

@krlvi krlvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thank you for this contribution. This fallback is indeed helpful

@krlvi krlvi merged commit 2e62a20 into gitbutlerapp:master Jan 6, 2026
21 of 22 checks passed
@godnight10061
Copy link
Contributor Author

Thanks for merging! I'm glad the fallback will be useful.

Byron added a commit to Byron/gitbutler that referenced this pull request Jan 6, 2026
Byron added a commit to Byron/gitbutler that referenced this pull request Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feedback requested Feedback was requested to help resolve the issue rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gerrit forge integration

3 participants