Ignore branch-ref decorations on merge commits when extracting issue keys#108
Merged
Conversation
axelniklasson
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
linear-release syncattached an issue (ACME-7) to a release though it appeared in no commit body and had no merged PR.Why: the CLI reads issue keys from branch names, deriving the branch from git's
%Dref decorations. A branch (ACME-7) created from an in-range commit but never committed onto still has its ref pointing at that commit. Withfetch-depth: 0the decoration is present, so the key leaked off the down-merge commit it was cut from.Fix
A ref on a merge commit is the mainline or a stale branch cut from it — never the work itself, and its branch name comes from the merge message anyway. A ref on a regular commit may be the only key source (GitLab fast-forward / direct push). So: read decorations only on regular commits.
Scenario (fixed)
Down merge trunk into release (#101)ACME-7(stale ref)[ACME-3] fix lookup (#102)Regular-commit decorations still work, so GitLab fast-forward features (key only in the branch name, on an interior commit) are preserved.
Tests
382 passing. New describe "branch refs decorating interior commits": negative (stale ref on an interior merge →
branchNamenull) + positive (FF feature on an interior regular commit → branch name kept — the coverage gap that let the original behavior regress).Fixes LIN-75064