Skip to content

fix: commit annotator fails on merge commits - #1846

Merged
sasa-tomic merged 1 commit into
mainfrom
fix/commit-annotator-merge-parent
Dec 12, 2025
Merged

fix: commit annotator fails on merge commits#1846
sasa-tomic merged 1 commit into
mainfrom
fix/commit-annotator-merge-parent

Conversation

@sasa-tomic

Copy link
Copy Markdown
Contributor

Summary

  • Fix bug where commit annotator crashes when traversing merge commits
  • The parent() method returned all parent hashes as a single space-separated string (e.g., "abc123 def456" for merge commits)
  • When passed to subsequent git commands, this fails with fatal: ambiguous argument
  • Now correctly returns only the first parent (main line of development)

Test plan

  • Verified fix works with the problematic merge commit 73ec91ef026f5163c35d991eb38e98890ac8e8c0
  • CI passes

The `parent()` method returns all parent hashes as a space-separated
string. For merge commits, this returns two hashes (e.g.,
"abc123 def456"), which when passed to subsequent git commands fails
with "ambiguous argument".

Fix by splitting the output and returning only the first parent,
which follows the main line of development.
@sasa-tomic
sasa-tomic requested a review from a team as a code owner December 12, 2025 17:14
@sasa-tomic
sasa-tomic enabled auto-merge (squash) December 12, 2025 17:16
@sasa-tomic
sasa-tomic merged commit 42b7a6e into main Dec 12, 2025
8 checks passed
@sasa-tomic
sasa-tomic deleted the fix/commit-annotator-merge-parent branch December 12, 2025 17:24
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.

2 participants