Skip to content

fix(standard): content-based branch-landed check for rebase/squash merges - #30

Merged
PBNZ merged 3 commits into
mainfrom
fix/session-end-branch-check
Aug 12, 2026
Merged

fix(standard): content-based branch-landed check for rebase/squash merges#30
PBNZ merged 3 commits into
mainfrom
fix/session-end-branch-check

Conversation

@PBNZ

@PBNZ PBNZ commented Aug 12, 2026

Copy link
Copy Markdown
Owner

What & why

The session-end checklist's first item relied on git branch -a --no-merged, an ancestry test that reports every rebase- or squash-merged branch as unmerged forever — blocking the safe -d and training the reflexive -D habit. The item now names the over-report, prescribes confirming a branch landed by content before force-deleting (gh pr list --state merged --head <branch>, or git log --cherry for no-PR rebases), forbids -D when both checks fail, and closes the remote half with gh repo edit --delete-branch-on-merge + git fetch --prune. The sentence agent-collaboration.md quotes verbatim is unchanged.

Refs #28

Checklist

🤖 Generated with Claude Code

The session-end checklist's first item relied on `git branch -a
--no-merged`, an ancestry test: on rebase- or squash-merging repos every
landed branch is reported unmerged forever, `git branch -d` refuses it by
the same test, and the only way to clear the box was the reflexive
`git branch -D` habit the checklist should be training away.

The item keeps `--no-merged` as the enumerator but names the over-report,
prescribes confirming the change landed by content before force-deleting
(`gh pr list --state merged --head <branch>`; `git log --cherry` for
no-PR rebases), forbids `-D` when both checks fail, and closes the remote
half with `gh repo edit --delete-branch-on-merge` plus `git fetch
--prune`. The sentence quoted verbatim by agent-collaboration.md is
unchanged.

Refs #28

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates RepoKit’s repo-standard guidance to avoid false “unmerged branch” signals on repos that use rebase/squash merges, and records the change in project tracking docs.

Changes:

  • Expands the session-end checklist branch hygiene item to explain why --no-merged over-reports on rebase/squash merges and to prescribe content-based confirmation before force-deleting.
  • Updates the repo’s resume-state checkpoint to reflect current in-progress work.
  • Adds a changelog entry documenting the standard correction.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
plugins/repokit/skills/repo-standard/standard/session-end-checklist.md Rewords the “No undecided branches” item to address rebase/squash merge behavior and provide safer cleanup steps.
docs/CHECKPOINT.md Updates resume-state metadata and next steps to match current work.
CHANGELOG.md Records the checklist correction under Unreleased.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +13 to +16
- the branch had a PR: `gh pr list --state merged --head <branch>` lists it → landed;
- no PR: `git log --oneline --cherry main...<branch>` — every commit marked `=` has a
patch-equivalent commit on `main` (the rebase case) → landed. A squash-merged multi-commit
branch still shows `+` here; judge that one by its PR.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verified empirically before changing anything — the claim doesn't hold: --cherry is a synonym for --right-only --cherry-mark --no-merges (git-log docs), so the =/+ markers are shown. Reproduction (git 2.x, branch with two commits cherry-picked to main plus one unlanded):

$ git log --oneline --cherry main...feature
+ 6b54fca change 3 unlanded
= e8eb270 change 2
= 0502ff3 change 1

The item stays mechanically checkable as written, so no change made.

— 🤖 Claude Code (Fable 5), on behalf of @PBNZ

Comment thread CHANGELOG.md
Comment on lines +12 to +17
- The session-end checklist's branch item no longer strands rebase/squash-merged branches
(#28): `git branch -a --no-merged` is named as an ancestry test that over-reports on those
merge methods, the item prescribes content-based confirmation before force-deleting
(`gh pr list --state merged --head`, or `git log --cherry` for no-PR rebases) with an
explicit "never `-D` a branch that fails both checks", and the remote half is closed by the
`gh repo edit --delete-branch-on-merge` + `git fetch --prune` recipe.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

No mismatch to fix: the checklist item and the changelog reference the same command (git log --oneline --cherry), and --cherry implies --cherry-mark (it is a synonym for --right-only --cherry-mark --no-merges), so the =/+ marker interpretation matches what the command prints — see the reproduction in the sibling thread.

— 🤖 Claude Code (Fable 5), on behalf of @PBNZ

PBNZ and others added 2 commits August 13, 2026 00:13
Copilot review on PR #30: the checkpoint described pre-PR actions that
are already done. Now states the open PRs and the remaining owner steps.
Identical content lands via PR #29 so the second merge stays clean.

Refs #28

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Refs #28

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PBNZ
PBNZ merged commit 88a79fc into main Aug 12, 2026
6 checks passed
@PBNZ
PBNZ deleted the fix/session-end-branch-check branch August 12, 2026 12:28
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