Skip to content

Bump overcommit to 0.72.0 for worktree merge fix - #1334

Open
apiology wants to merge 1 commit into
castwide:masterfrom
apiology:bump-overcommit-0-72
Open

apiology wants to merge 1 commit into
castwide:masterfrom
apiology:bump-overcommit-0-72

Conversation

@apiology

@apiology apiology commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude:

Problem: In a git worktree — the default working style for AI coding agents — merging and committing silently produces a commit that says it is a merge but that git does not record as one, so the branch still looks unmerged and gets merged again.

$ git log --oneline -1
abc1234 Merge branch 'my-branch'      # says merged

$ git branch --merged | grep my-branch
                                      # nothing — git disagrees

Solution: Bump to overcommit 0.72.0, which carries sds/overcommit#887 — 0.71.0 looked for git's merge bookkeeping in the main checkout rather than the worktree's own.

Overcommit 0.71.0 resolves operation-state files (MERGE_HEAD,
MERGE_MSG, MERGE_MODE) through `git rev-parse --git-common-dir`,
which in a linked worktree points at the primary checkout's `.git`
rather than the per-worktree directory where git actually writes
them.

store_merge_state therefore reads files that are not there, and
restore_merge_state writes them back into the primary `.git`.
Because clear_working_tree runs `git reset --hard` whenever
overcommit stashes, a `git merge` followed by `git commit` from a
linked worktree produces a single-parent commit whose subject still
reads "Merge ...".

Fixed upstream by sds/overcommit#887, released in v0.72.0, which
adds Overcommit::Utils.git_path built on `git rev-parse --git-path`
and routes the operation-state files through it.

Gemfile.lock is gitignored here, so only the gemspec constraint
changes. Locally the bump also tightens overcommit's own rexml
dependency from >= 3.3.9 to >= 3.4.2 (CVE-2025-58767); the resolved
rexml 3.4.4 already satisfied both.
@apiology
apiology marked this pull request as ready for review September 4, 2026 00:22
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