gabeklein / gabeklein/git-workflow
Landed detection misses a squash that was edited during merge
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 3h 16m
- Merged PRs (30d)
- 65
Description
landedProbe proves a branch landed three ways — ancestry, content-neutral merge, and reproducing the squash it landed as. All three compare against the base's current tree, which is what makes them revert-safe.
They share a blind spot: a squash landing that was edited during merge (a reviewer's tweak applied in the GitHub merge box, a conflict resolved on the way in). The base then contains work that is not byte-identical to anything the branch produced, so:
- ancestry says no (squash),
- the content merge says no (the base has extra edits),
- the squash reproduction says no (it reproduces the branch's tree, not the edited one).
The lane sits in the preview forever, reporting a conflict against work nobody disputes, and Prune never offers it.
The signal that would catch it
gh pr list --state merged --json headRefName,headRefOid gives, per merged PR, the branch tip as merged. When the lane's tip equals headRefOid and the PR is merged, the lane landed — whatever the base tree now looks like — because no work has been added since the thing that was merged.
This existed as listMergedPrHeads on the abandoned feat/lane-lifecycle branch (Aug 23), which is otherwise superseded and being deleted; recording it here so the idea is not lost with it.
Notes for whoever picks it up
- It is a fourth sound probe, not a replacement: like the others it may only ever say "landed", never "not landed", so the union stays strictly better.
- It needs
ghand is therefore optional —isGithubPrIntegrationEnabled()gates it, and everything must still work without it. - Revert-safety needs thought: a merged-then-reverted PR still reports merged, so this probe alone would wrongly retire it. The existing content check is what makes the current set revert-safe, so pairing them (merged PR and the tip is unreachable-but-not-reverted) is the part to get right.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing landedProbe and its three probes, then inspect isGithubPrIntegrationEnabled and the gh pr list --state merged --json headRefName,headRefOid integration. Add the merged-head signal as a fourth probe while preserving the existing content check for revert safety and keeping the behavior unchanged when gh integration is disabled. Done means edited squash merges are detected without retiring merged-then-reverted work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github, typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100