Skip to content

fix(git): preserve commas in legacy history decorations - #35658

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/git-history-legacy-comma-refs
Oct 30, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/git-history-legacy-comma-refs

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On Git older than 2.43, the history panel cannot use %(decorate:...) and falls back to parsing %D. That fallback split the decoration string on every ,. Ref names may legally contain commas (e.g. feat,one), so such branches, remotes, and tags showed truncated badges with the wrong name and id.

Fix

Split the legacy %D output on ", ", the exact separator Git uses between decorations. Ref names cannot contain spaces, so the separator can never occur inside a name. The modern \x1f path is unchanged.

Validation

  • Added a parser regression test covering a branch, remote, and tag with commas in the legacy format; it fails with the old separator and passes with the fix.
  • pnpm test src/shared/git-history.test.ts: 13/13 pass.
  • pnpm check:changed --maxWorkers=2: all 21 checks pass.

@OrcaWin
OrcaWin marked this pull request as ready for review October 30, 2026 09:40
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f1d8910-9b44-486d-9c8a-77e94eb34e5a
Commits

Reviewing files that changed from the base of the PR and between fa2a5d2 and d0ca901.

Files selected for processing: 2
  • src/shared/git-history-log-parser.ts
  • src/shared/git-history.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The legacy Git decoration separator changes from a comma to a comma followed by a space. A parser test checks that commas within branch, remote-branch, and tag names remain part of each name, and that each reference is categorized correctly.

Priority: Low

Severity of issue fixed: Low

Merge Risk: Minimal · up to d0ca9

The parser change correctly preserves commas in legacy Git decorations without leaving an identified merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description clearly explains the problem, fix, mechanism, and validation. However, it does not use the required template sections and omits the Linked Issue, Visual Proof or N/A statement, AI Disc… Update the description to include the required template headings and information. Add the linked issue, state N/A with a reason for Visual Proof, complete Testing and checklist items, and address the remaining required sections.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: preserving commas in legacy Git history decorations.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Full details: Description check

Explanation

The description clearly explains the problem, fix, mechanism, and validation. However, it does not use the required template sections and omits the Linked Issue, Visual Proof or N/A statement, AI Disclosure, Review, Notes, Agent skill upstream boundary, and Checklist sections.

Resolution

Update the description to include the required template headings and information. Add the linked issue, state N/A with a reason for Visual Proof, complete Testing and checklist items, and address the remaining required sections.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit ae8b0c7 into main Oct 30, 2026
82 checks passed
@OrcaWin
OrcaWin deleted the OrcaWin/git-history-legacy-comma-refs branch October 30, 2026 09:55
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.

1 participant