pre-push: pushing annotated tags crashes with "Failed to find merge base: object is no commit object" #1196
ReproAny repo with an hk-managed git tag -a v1.0.0 -m v1.0.0
git push origin v1.0.0or by simulating the git hook protocol directly: echo "refs/tags/v1.0.0 <tag-object-sha> refs/tags/v1.0.0 0000000000000000000000000000000000000000" | hk run pre-pushErrorThe hook exits non-zero, so git aborts the push entirely. Root cause
Suggested fixPeel the objects to commits before computing the merge base ( Arguably tag-only pushes could skip file computation entirely: a tag carries no new file changes. ImpactAny repo with an hk pre-push hook cannot push tags without Reproduced on hk 1.54.1 and 1.55.0, macOS arm64, git 2.54.0. |
Replies: 1 comment
|
Thanks for the detailed report and root-cause analysis. Confirmed: the failure is isolated to the libgit2 path, which passed the annotated tag object ID directly to Fixed in #1197 by peeling both refs to commits before calculating the merge base. The PR also adds an end-to-end annotated-tag push regression test and verifies it with both libgit2 enabled and disabled. AI-assisted — Tool: Codex; model: openai/gpt-5; version: unavailable. |
Thanks for the detailed report and root-cause analysis. Confirmed: the failure is isolated to the libgit2 path, which passed the annotated tag object ID directly to
merge_base; the shell-git path already succeeds because Git peels the tag.Fixed in #1197 by peeling both refs to commits before calculating the merge base. The PR also adds an end-to-end annotated-tag push regression test and verifies it with both libgit2 enabled and disabled.
AI-assisted — Tool: Codex; model: openai/gpt-5; version: unavailable.