Skip to content

Wire-up RefInfo change-ids in commits to UI (#GB-1165)#13151

Merged
Byron merged 11 commits intogitbutlerapp:masterfrom
Byron:wire-change-ids
Apr 12, 2026
Merged

Wire-up RefInfo change-ids in commits to UI (#GB-1165)#13151
Byron merged 11 commits intogitbutlerapp:masterfrom
Byron:wire-change-ids

Conversation

@Byron
Copy link
Copy Markdown
Collaborator

@Byron Byron commented Apr 1, 2026

This makes the change-ids usable in the UIs.
Note that they won't be stable unless the rebase engine also persists synthetic IDs instead of creating random ones, but that needs more work in a couple of well-known places. This is left as a follow-up.

UpstreamCommit is still using Option for its change_id, as I don't yet know how important it is to provide one (after all, it's not 'our' commits anyway and we probably shouldn't rebase them).

It's notable that the backend still keeps Option to be sure places like integration-checks won't be negatively affected. There, I also prefer keeping the presence of a change-id explicit as it's easy to synthesize one when that is truly needed (and for the backend, there is no case for it yet).

Tasks

  • refackiew
  • fix CI properly
  • don't use cache for ChangeIDs but instead produce them deterministically like JJ.
    • refackiew
  • make change-ids mandatory (they can be synthesized from the hash)
  • adapt frontends to type-change of change-id (fair enough) and review
  • look at remaining auto-review

Notes for the reviewer

These change-ids won't be fully functional as they are not currently persisted by the rebase-engine and when creating new commits. Thus they will not be stable. Also, they don't implement the /X suffix for when there is known duplicates.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Skipped Skipped Apr 1, 2026 10:39pm

Request Review

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

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

A member of the Team first needs to authorize it.

@Byron Byron marked this pull request as ready for review April 1, 2026 23:43
Copilot AI review requested due to automatic review settings April 1, 2026 23:43
@Byron Byron requested a review from OliverJAsh April 1, 2026 23:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Wires GitButler commit change-ids through the but-workspace UI-facing commit types so the desktop/web UIs can display and use them when available.

Changes:

  • Add change_id: Option<String> to ui::Commit and ui::UpstreamCommit.
  • Populate change_id from commit headers across multiple code paths (gix commits, but_core::CommitOwned, ref_info conversions).
  • Propagate change_id into legacy stack commit output and branch-details commit traversal output.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
crates/but-workspace/src/ui/mod.rs Adds change_id to UI commit structs and populates it in conversion impls.
crates/but-workspace/src/legacy/stacks.rs Includes change_id in legacy stack ui::Commit construction.
crates/but-workspace/src/branch_details.rs Extracts change_id during local/upstream commit traversal for branch details output.

@Byron Byron force-pushed the wire-change-ids branch from f8b06f3 to 53e3403 Compare April 1, 2026 23:53
Copilot AI review requested due to automatic review settings April 2, 2026 00:01
@Byron Byron force-pushed the wire-change-ids branch from 53e3403 to 272d5aa Compare April 2, 2026 00:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings April 2, 2026 02:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

@Byron Byron force-pushed the wire-change-ids branch from d722085 to ef65c5f Compare April 2, 2026 03:08
Copilot AI review requested due to automatic review settings April 2, 2026 03:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

@Byron Byron force-pushed the wire-change-ids branch from ef65c5f to 0c6349e Compare April 2, 2026 03:20
@Byron Byron marked this pull request as draft April 7, 2026 08:28
@Byron Byron force-pushed the wire-change-ids branch 5 times, most recently from 279f1ad to 757406f Compare April 10, 2026 09:43
@Byron Byron marked this pull request as ready for review April 10, 2026 09:53
Copilot AI review requested due to automatic review settings April 10, 2026 09:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 54 out of 57 changed files in this pull request and generated 1 comment.

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dcee53ad05

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI review requested due to automatic review settings April 10, 2026 12:55
@Byron Byron force-pushed the wire-change-ids branch from e699a7c to 3813b56 Compare April 10, 2026 12:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 53 out of 56 changed files in this pull request and generated 2 comments.

@Byron Byron marked this pull request as draft April 10, 2026 13:07
codex and others added 10 commits April 10, 2026 21:31
This makes the change-ids usable.
Note that they won't be stable unless the rebase engine uses the
ones in the cache instead of persisting.

Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
This also introduces a separate schema version for the project cache,
which certainly change more easily as it never results in caches not
coming up.

This works as failed migrations will lead to the cache db to be deleted,
and restarted from scratch, so older applications can always restore
something usable without falling back to in-memory caches.

Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Also make it easy to fill headers with a `change-id` if CommitId
is initially known.

Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Co-authored-by: GPT 5.4 <codex@openai.com>
In future, we might want to parameterise it accordingly to create
SHA256 style IDs.
In practice, it probably doesn't matter though.
- clarify ChangeIDs - they actually have a hash-independent format.
This means that newer caches versions that are incompatible won't be overwritten
or cleared by older clients. They will instead open in memory,
which seems like it's desirable behaviour.

Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
@Byron Byron force-pushed the wire-change-ids branch from 1e4e8c9 to 70a9743 Compare April 10, 2026 13:32
@Byron Byron marked this pull request as ready for review April 10, 2026 13:32
Copilot AI review requested due to automatic review settings April 10, 2026 13:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 57 out of 60 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

crates/but-core/src/change_id.rs:35

  • The doc comment says the generated change-id is “(SHA-1)”, but ChangeId::generate() is 16 random bytes encoded as 32 reverse-hex characters; it isn’t a SHA-1 hash (SHA-1 would be 20 bytes / 40 hex chars). Consider rephrasing to avoid implying a cryptographic hash algorithm is used (e.g., just “32-char reverse-hex ChangeId” or “16-byte random ChangeId encoded as reverse-hex”).
    /// Creates a random length 32 reverse hex ChangeId (SHA-1).
    pub fn generate() -> Self {
        let mut rng = rand::rng();
        let bytes: [u8; CHANGE_ID_REVERSE_BYTE_LEN] = rng.random();
        ChangeId::from_bytes(&bytes)

@Byron Byron enabled auto-merge April 11, 2026 23:54
@Byron Byron merged commit 089dc67 into gitbutlerapp:master Apr 12, 2026
41 of 42 checks passed
@Byron Byron deleted the wire-change-ids branch April 12, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants