You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replaces git pull on the integration/production branches with git fetch + git reset --hard origin/<branch> so the local branch becomes a perfect mirror of the remote after every CodeCannon-driven merge.
The previous git pull after gh pr merge --merge was creating a second, parallel merge commit locally for the same logical PR — once any divergence existed, every iteration compounded it (the symptom in the linked issue: 466 vs 465 different commits, near-empty content diff). Hard reset is safe because the workflow forbids direct commits to the integration/production branches, so there is no local work to lose (and git reflog keeps a 90-day safety net regardless).
skills/start.md Step 4 (Case A and Case B, both BRANCH_DEV and BRANCH_PROD variants) — same pattern.
skills/deploy.md Step 1 sync — bare git pull → git fetch && git reset --hard @{u} (uses upstream so it works for whichever branch the project's deploy mode requires).
The change faithfully implements the fix described in #156: replaces git pull with git fetch + git reset --hard origin/<branch> in the four sites that sync the integration/production branches (Makefile.agents.mkmerge: target, skills/start.md Case A and Case B Step 4, skills/deploy.md Step 1). All four rendered adapter outputs (.claude/, .cursor/, .agents/, .gemini/) match the templates and updated content hashes. The acceptance criteria from #156 are satisfied by the diff.
Findings
[NOTE] skills/deploy.md uses git reset --hard @{u} while skills/start.md and Makefile.agents.mk name the branch explicitly as origin/<branch>. Both forms are correct given the preceding git checkout / required-branch guard, but using @{u} introduces a small inconsistency and depends on the local branch having an upstream configured pointing at origin/<deploy-branch>. Naming the branch explicitly (matching the other two sites) would be marginally more defensive and stylistically consistent.
[NOTE] git reset --hard silently discards any uncommitted working-tree changes on the integration/production branch, whereas the previous git pull would have aborted loudly on a dirty tree. This is safe under the documented CodeCannon workflow (integration/prod branches are never edited locally — all changes flow through feature branches + PRs) and Local integration branch (dev) accumulates SHA-divergent history vs origin/dev over time — make merge uses git pull where it needs git reset --hard #156 already calls this out, with git reflog providing 90-day recovery. Worth being aware of as a behavior change for any user who had been hand-editing those branches against convention.
The new commit cleanly addresses both prior NOTEs and adds the local-only-commits warning specified in #156's recovery rationale.
Verified against the diff:
Dirty-tree guard (git diff --quiet && git diff --cached --quiet || abort) is present at every git reset --hard site: Makefile.agents.mkmerge:, skills/start.md Step 4 Case A and Case B (both BRANCH_DEV and BRANCH_PROD variants), and skills/deploy.md Step 1 (all three conditional blocks).
skills/deploy.md three-mode conditional now covers all three branching modes: {{#if BRANCH_TEST}} → reset to origin/{{BRANCH_TEST}}, {{#if !BRANCH_TEST}}{{#if BRANCH_DEV}} → reset to origin/{{BRANCH_DEV}}, {{#if !BRANCH_TEST}}{{#if !BRANCH_DEV}} → reset to origin/{{BRANCH_PROD}}. Matches the trunk/two-branch/three-branch documentation block at the top of Step 1.
The earlier @{u} form is gone — every site now names the branch explicitly as origin/<branch>, resolving the stylistic NOTE from the prior review.
Findings
[NOTE] The dirty-tree guard git diff --quiet && git diff --cached --quiet deliberately ignores untracked files. This is the right call — git reset --hard does not touch untracked files, so guarding against them would produce false aborts (e.g. editor swap files, build artifacts, .DS_Store) without protecting any user work.
[NOTE] The guard can produce a benign false abort if the working tree has uncommitted submodule pointer changes, file-mode flips (e.g. on filesystems where core.fileMode differs), or CRLF/autocrlf renormalization noise that leaves git diff non-empty without user-visible edits. The failure mode is loud (clear error message asking the user to resolve) rather than silent data loss, so this is the correct trade-off; flagging only for awareness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
git pullon the integration/production branches withgit fetch+git reset --hard origin/<branch>so the local branch becomes a perfect mirror of the remote after every CodeCannon-driven merge.The previous
git pullaftergh pr merge --mergewas creating a second, parallel merge commit locally for the same logical PR — once any divergence existed, every iteration compounded it (the symptom in the linked issue: 466 vs 465 different commits, near-empty content diff). Hard reset is safe because the workflow forbids direct commits to the integration/production branches, so there is no local work to lose (and git reflog keeps a 90-day safety net regardless).Changes:
Makefile.agents.mkmerge:target —git pull→git fetch+git reset --hard origin/$(INTEGRATION_BRANCH).skills/start.mdStep 4 (Case A and Case B, bothBRANCH_DEVandBRANCH_PRODvariants) — same pattern.skills/deploy.mdStep 1 sync — baregit pull→git fetch && git reset --hard @{u}(uses upstream so it works for whichever branch the project's deploy mode requires).Closes #156