Repository navigation
Conversation
…ath too _grc_bump_ndc_gen (hooks.d/after_save/60-git-reconcile.sh) was called from the fast-forward path and the successful-rebase path, but not from _grc_report_conflict -- the one remaining now.md-rewriting path. By the time _grc_report_conflict runs, `git rebase` has already failed with a real conflict, meaning it already rewrote the slug's now.md to conflict-marker content before the scoped quit/checkout restore even starts. An NDC consolidation round that snapshots now.md inside that window saw an unchanged generation counter and could trim local lines it never actually summarised (#932's reasoned consequence). Bump unconditionally at the top of _grc_report_conflict, mirroring the "bump as soon as the tree is rewritten, regardless of downstream success" rule the other two call sites already follow -- so a failed quit or checkout (still reported honestly) does not suppress it either. Added TestNdcGenerationBump.test_conflict_bumps_ndc_generation, reusing the same plain two-clone conflict shape as TestScopedAbort.test_file_added_by_the_upstream_side_before_the_conflict_is_pruned. Confirmed red before the fix (failed on the missing bump) and green after. Co-Authored-By: Claude Sonnet 5 <[email protected]>
… rationale comment
Explore review finding: the top-of-file comment explaining why
_grc_bump_ndc_gen exists at all ("bumping the SAME counter after a
successful fast-forward/rebase below...") was written for the original
two call sites and never updated when this same commit added the third,
the conflict path -- a reader skimming only this summary comment would
still believe the bump only fires on success paths. Updated to name the
conflict path too; the call site's own adjacent comment already explained
it correctly, this was the one older summary comment left stale.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
git-reconcile's conflict-handling path (
_grc_report_conflictinhooks.d/after_save/60-git-reconcile.sh) never called_grc_bump_ndc_gen, unlike the fast-forward and successful-rebase paths in the same hook. By the time_grc_report_conflictruns,git rebasehas already failed with a real conflict and already rewritten the slug'snow.mdto conflict-marker content -- the same "tree already rewritten, regardless of downstream success" shape the other two call sites are bumped for.Reasoned consequence (not reproduced, #932): an NDC consolidation round snapshotting
now.mdinside that window would see an unchanged generation counter and could trim local lines it never actually summarised.Fix: added an unconditional
_grc_bump_ndc_gencall at the top of_grc_report_conflict, before the quit/checkout outcome is known.Tests: added
TestNdcGenerationBump.test_conflict_bumps_ndc_generation-- a real two-clone conflict (no shim needed). Watched it fail first (1 failed, generation marker never created) by stashing the fix, then pass after unstashing. Full file:pytest tests/test_git_reconcile_903.py -q-> 21 passed, run twice, no regressions.Self-review: Explore and oss:auditor reviewed concurrently. Explore found one stale-prose finding -- the rationale comment above
_grc_bump_ndc_gen's definition still only named the fast-forward/rebase paths -- fixed in a follow-up commit. oss:auditor's checklist (silent-absence-via-sequencing, guard-nominally-on, untrusted-text-boundary-forging, cross-platform skip coverage) came back clean with reasoning shown for each class.Closes #954
🤖 Generated with Claude Code
[AI-generated]