feat(sling): add --no-merge flag to skip merge queue (#939)

When contributing to upstream repos or wanting human review before merge,
the --no-merge flag keeps polecat work on a feature branch instead of
auto-merging to main.

Changes:
- Add --no-merge flag to gt sling command
- Store no_merge field in bead's AttachmentFields
- Modify gt done to skip merge queue when no_merge is set
- Push branch and mail dispatcher "READY_FOR_REVIEW" instead
- Add tests for field parsing and sling flag storage

Closes: gt-p7b8

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
David Van Couvering
2026-01-25 18:08:34 -08:00
committed by GitHub
parent a86c7d954f
commit 92ccacffd9
6 changed files with 278 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ type AttachmentFields struct {
AttachedAt string // ISO 8601 timestamp when attached
AttachedArgs string // Natural language args passed via gt sling --args (no-tmux mode)
DispatchedBy string // Agent ID that dispatched this work (for completion notification)
NoMerge bool // If true, gt done skips merge queue (for upstream PRs/human review)
}
// ParseAttachmentFields extracts attachment fields from an issue's description.
@@ -65,6 +66,9 @@ func ParseAttachmentFields(issue *Issue) *AttachmentFields {
case "dispatched_by", "dispatched-by", "dispatchedby":
fields.DispatchedBy = value
hasFields = true
case "no_merge", "no-merge", "nomerge":
fields.NoMerge = strings.ToLower(value) == "true"
hasFields = true
}
}
@@ -95,6 +99,9 @@ func FormatAttachmentFields(fields *AttachmentFields) string {
if fields.DispatchedBy != "" {
lines = append(lines, "dispatched_by: "+fields.DispatchedBy)
}
if fields.NoMerge {
lines = append(lines, "no_merge: true")
}
return strings.Join(lines, "\n")
}
@@ -117,6 +124,9 @@ func SetAttachmentFields(issue *Issue, fields *AttachmentFields) string {
"dispatched_by": true,
"dispatched-by": true,
"dispatchedby": true,
"no_merge": true,
"no-merge": true,
"nomerge": true,
}
// Collect non-attachment lines from existing description