Skip to content

fix: correct invalid git for-each-ref syntax in post-merge-cleanup skill#1946

Merged
Aureliolo merged 1 commit into
mainfrom
fix/post-merge-cleanup-gone-branch-syntax
May 16, 2026
Merged

fix: correct invalid git for-each-ref syntax in post-merge-cleanup skill#1946
Aureliolo merged 1 commit into
mainfrom
fix/post-merge-cleanup-gone-branch-syntax

Conversation

@Aureliolo
Copy link
Copy Markdown
Owner

Summary

  • The post-merge-cleanup skill's "gone branch" detection used %(upstream:track,gone) in git for-each-ref --format, which is invalid git format syntax (there is no gone atom modifier). It fails on every git version with fatal: unrecognized %(upstream) argument: track,gone, so step 3 (delete local branches whose remote is gone) never worked.
  • Replaced with plain %(upstream:track), which already emits [gone] for branches whose upstream was deleted. The downstream grep '\[gone\]$' and the rest of the skill are unaffected.
- git for-each-ref --format='%(refname:short) %(upstream:track,gone)' refs/heads | grep '\[gone\]$'
+ git for-each-ref --format='%(refname:short) %(upstream:track)' refs/heads | grep '\[gone\]$'

Test plan

  • Verified git for-each-ref --format='%(refname:short) %(upstream:track)' refs/heads runs without error on git 2.54 (the ,gone form errors out).
  • git grep confirms no other tracked file carries the broken syntax (no OpenCode mirror to keep in parity).

Review coverage

Docs-only change to a single .claude/ skill file. Pre-PR pipeline auto-skipped the agent roster (no substantive code, no .py/.go/.tsx, no diagram fences); automated checks had nothing to run (no Python/web/Go changes). Parity check performed manually.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a functional issue in the post-merge-cleanup skill documentation. By correcting an invalid git command syntax that prevented the identification of stale branches, the change ensures that the cleanup process operates as intended across all supported Git versions.

Highlights

  • Syntax Correction: Fixed an invalid git for-each-ref command in the post-merge-cleanup skill that was failing due to an unsupported 'gone' modifier.
  • Functionality Restoration: Updated the command to use the correct %(upstream:track) syntax, which correctly identifies deleted upstream branches for cleanup.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: bd07261a-0c97-427a-b9e9-af9032d2c509

📥 Commits

Reviewing files that changed from the base of the PR and between 484c1d3 and 7859a55.

📒 Files selected for processing (1)
  • .claude/skills/post-merge-cleanup/SKILL.md
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (go)
🔇 Additional comments (1)
.claude/skills/post-merge-cleanup/SKILL.md (1)

22-22: LGTM!


Walkthrough

This PR updates the git for-each-ref command in the post-merge cleanup skill workflow. The change removes the gone modifier from the %(upstream:track,gone) format specifier while preserving the downstream grep '\[gone\]$' filter that selects branches with gone upstream tracking status. The filtering behavior remains functionally equivalent after the modification.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing invalid git syntax in the post-merge-cleanup skill's git for-each-ref command.
Description check ✅ Passed The description is directly related to the changeset, explaining the invalid syntax issue, the fix, testing performed, and verification methods.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the SKILL.md documentation for post-merge cleanup by refining the git for-each-ref command used to identify branches with a 'gone' upstream status. The reviewer suggested appending | awk '{print $1}' to the command to extract only the branch names, which facilitates easier manual or scripted cleanup.


```bash
git for-each-ref --format='%(refname:short) %(upstream:track,gone)' refs/heads | grep '\[gone\]$'
git for-each-ref --format='%(refname:short) %(upstream:track)' refs/heads | grep '\[gone\]$'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While the current command correctly identifies branches with a [gone] upstream status, the output includes the status suffix (e.g., branch-name [gone]). This requires manual extraction of the branch name before running the subsequent git branch -D <branch-name> command. Appending | awk '{print $1}' would provide a clean list of branch names that can be directly used or copied.

Suggested change
git for-each-ref --format='%(refname:short) %(upstream:track)' refs/heads | grep '\[gone\]$'
git for-each-ref --format='%(refname:short) %(upstream:track)' refs/heads | grep '\[gone\]$' | awk '{print $1}'

@Aureliolo Aureliolo merged commit 69a1649 into main May 16, 2026
42 checks passed
@Aureliolo Aureliolo deleted the fix/post-merge-cleanup-gone-branch-syntax branch May 16, 2026 20:12
Aureliolo pushed a commit that referenced this pull request May 17, 2026
<!-- HIGHLIGHTS_START -->
## Highlights

> _AI-generated summary (model: `openai/gpt-4.1-mini` via GitHub
Models). Commit-based changelog below._

### What you'll notice
- Frontend WP-6 update with UX polish improves user interface and
workflow.
- Dashboard and training endpoint improvements enhance observability and
dispatch behavior.
- Web storybook now supports change detection for more responsive UI
interactions.
- Git hooks now isolated per worktree for cleaner repository management.
- Providers automatically detect native streaming support in Litellm
models.

### What's new
- Added a new pipeline to convert Pydantic DTOs to TypeScript for better
front-end compatibility.

### Under the hood
- Refactored settings to three precedence categories, removing YAML tier
for simpler configuration.
- Completed RootConfig mirror coverage for enhanced configuration
consistency.
- Adopted API conventions with better query performance and forbidden
extra fields for stricter validation.
- Improved persistence, layer discipline, and restart safety in core
work packages.
- CI updated with split test jobs and tightened coverage gates for
better test quality.
- Switched to direct Trivy binary for security scans, removing previous
Trivy action dependency.
- Enhanced memory management with per-call processing options and better
observability during speech-to-text encoding.
- Various dependency updates for Python, infrastructure, and lock files
maintain security and stability.
- Removed TypeScript DTO type-tightening overlays to simplify type
management.
- Codebase audit tightened skill sets to prevent false positivity in
class detection by 2026.

<!-- HIGHLIGHTS_END -->

:robot: I have created a release *beep* *boop*
---


##
[0.8.5](v0.8.4...v0.8.5)
(2026-05-17)


### Features

* **codegen:** pydantic-to-typescript DTO pipeline + parity gate (closes
[#1889](#1889))
([#1909](#1909))
([0265ef5](0265ef5))
* **storybook:** enable changeDetection + trim web/CLAUDE.md
([#1939](#1939))
([3b1f4c0](3b1f4c0))
* **web,setup:** WP-6 frontend + UX polish
([#1941](#1941))
([d9ca76d](d9ca76d))


### Bug Fixes

* correct invalid git for-each-ref syntax in post-merge-cleanup skill
([#1946](#1946))
([69a1649](69a1649))
* dashboard polish, training endpoint dispatch, and observability
cleanup ([#1911](#1911))
([b61e9e8](b61e9e8))
* per-worktree git-hook isolation + hookify gate migration + MSW drift
fix ([#1949](#1949))
([e3f8495](e3f8495))
* **providers:** read supports_native_streaming from litellm model info
([#1942](#1942))
([60364ca](60364ca))
* security and audit coverage (closes
[#1883](#1883))
([#1904](#1904))
([d8ebf55](d8ebf55))


### Performance

* **ci:** mypy --num-workers=4 + enable ruff TID255
([#1944](#1944))
([484c1d3](484c1d3))


### Refactoring

* **ci:** drop aquasecurity/trivy-action, use direct trivy binary
([#1940](#1940))
([df1f946](df1f946))
* **memory:** per-call processing_kwargs + observability for ST encode
([#1943](#1943))
([3aa9d20](3aa9d20))
* Phase 7 follow-up — complete RootConfig mirror coverage (closes
[#1907](#1907))
([#1914](#1914))
([605500b](605500b))
* **settings:** collapse precedence to three categories; drop YAML tier
(closes [#1890](#1890))
([#1910](#1910))
([efd54c9](efd54c9))
* WP-3 API conventions + query performance + project-wide extra=forbid
([#1953](#1953))
([504d579](504d579)),
closes [#1918](#1918)
* WP-4 settings + cross-cutting (clock seam, contextvars, dispatch,
plugin surfaces)
([#1954](#1954))
([7207d92](7207d92))
* **wp1:** persistence + layer discipline + restart safety
([#1945](#1945))
([57586fb](57586fb))


### Documentation

* **wp5:** public-facing truth refresh
([#1924](#1924))
([afb5cc5](afb5cc5))


### CI/CD

* split test job by marker with airtight aggregate coverage gate
([#1948](#1948))
([0b818d5](0b818d5)),
closes [#1938](#1938)
[#1937](#1937)


### Maintenance

* **codebase-audit:** tighten skill to prevent 2026-05-15 FP classes
([#1923](#1923))
([9317ed1](9317ed1))
* Lock file maintenance
([#1913](#1913))
([c08a355](c08a355))
* Lock file maintenance
([#1950](#1950))
([8940ab1](8940ab1))
* remove TS DTO type-tightening overlays
([#1915](#1915))
([d296214](d296214)),
closes [#1906](#1906)
* Update Infrastructure dependencies
([#1928](#1928))
([d19fae5](d19fae5))
* Update Python dependencies
([#1929](#1929))
([75cc2c8](75cc2c8))
* **wp7:** hygiene, stubs, test/CI/tooling, doc gaps, boundary patterns
doc ([#1926](#1926))
([c29eb32](c29eb32))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: synthorg-repo-bot[bot] <279117679+synthorg-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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