Skip to content

Conversation

@Data-Wise
Copy link
Owner

Summary

  • fix: False positive production conflicts from --no-ff merge commits (teach deploy: false positive 'production conflicts' from merge commits #372) — uses --is-ancestor fast path + git log --no-merges filter
  • feat: Auto back-merge after direct deploy (step 6/6) prevents recurrence
  • feat: teach deploy --sync for manual branch synchronization
  • refactor: ZSH always block for guaranteed cleanup, DRY commit failure helper
  • fix: Three-dot diff syntax in deploy preflight math check
  • test: 7 dedicated conflict detection tests + 16 E2E/dogfood assertions (43/43 suites)

Test plan

  • 43/43 test suites passing (./tests/run-all.sh)
  • 7/7 conflict detection unit tests
  • 45/45 E2E deploy tests (includes back-merge, skip status)
  • 71/71 dogfood deploy tests (includes --sync, three-dot diff)
  • Plugin loads cleanly (source flow.plugin.zsh)

🤖 Generated with Claude Code

Data-Wise and others added 3 commits February 10, 2026 17:34
* fix: replace merge-base conflict detection with is-ancestor + no-merges (#372)

_git_detect_production_conflicts() counted all commits (including --no-ff
merge commits from direct deploy) as "production ahead", creating permanent
false positives. Now uses --is-ancestor fast path and --no-merges filter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: auto back-merge after direct deploy to prevent false conflict recurrence

After direct merge, ff-only merge production back into draft to keep branches
in sync. Prevents #372 recurrence where merge commits accumulate. Reports
outcome as step 6/6 — skip with guidance if draft has diverged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add teach deploy --sync for manual branch synchronization

Escape hatch when auto back-merge skips (draft has new commits). Tries
ff-only first, falls back to regular merge. Added to help text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: wrap deploy body in ZSH always block for global cleanup

ZSH always block guarantees _deploy_cleanup_globals runs on every exit
path (return, error, signal). Removes two explicit cleanup calls that
could be missed on early returns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: extract _deploy_commit_failure_guidance helper (DRY)

Three identical commit-failure blocks replaced with single helper function.
Standardizes messaging across all commit paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: standardize three-dot diff syntax in deploy preflight

Math blank-line check used two-dot diff which could surface production-only
files as false positives. Three-dot shows only what changed on draft since
divergence, matching the semantic intent of all other deploy diffs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add dedicated tests for production conflict detection

7 test cases covering: same commit, draft ahead, real conflicts, --no-ff
merge commits (core #372 scenario), is-ancestor fast path, back-merge sync,
and accumulated merge commits. Also updates E2E step count 5→6.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add E2E and dogfood tests for back-merge, --sync, and conflict detection

E2E (6 new tests):
- Back-merge sync step appears in output [6/6]
- Draft contains production HEAD after back-merge
- Deploy succeeds when back-merge skips (non-ff)
- No false positive after deploy + back-merge
- Conflict detection ignores 3 cycles of --no-ff merges
- _deploy_step renders skip status

Dogfood (10 new tests using demo course):
- Helper function loaded, help includes --sync
- _deploy_step skip, commit failure guidance output
- --sync accepted and works on synced branches
- Direct deploy includes back-merge step [6/6]
- Conflict detection returns 0 after demo deploy
- Multiple deploys produce no false positives
- Three-dot diff syntax verified in source

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…etection docs

- Register test-production-conflict-detection.zsh in run-all.sh (42→43 suites)
- Update CLAUDE.md test counts (144 files, 43/43 suites) and deploy extras
- Update API reference: _git_detect_production_conflicts new algorithm docs
- Add --sync to refcard commands, flags, and output format (5→6 steps)
- Update deploy guide: conflict detection ignores merges, --sync workflows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Data-Wise Data-Wise merged commit a83282a into main Feb 11, 2026
2 checks passed
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