Skip to content

Recover exact rewrite line attribution#1503

Draft
svarlamov wants to merge 1 commit into
feat/rebase-conflict-resolution-attributionfrom
feat/rebase-logical-line-recovery
Draft

Recover exact rewrite line attribution#1503
svarlamov wants to merge 1 commit into
feat/rebase-conflict-resolution-attributionfrom
feat/rebase-logical-line-recovery

Conversation

@svarlamov
Copy link
Copy Markdown
Member

Summary

  • Move exact logical-line recovery into the main rewrite note-shift path so preserved source lines keep attribution even when Git hunks treat the area as replaced.
  • Remove the conflict-resolution-only recovery hook and keep conflict working-log merging focused on newly checkpointed resolution lines.
  • Update conflict regression tests to assert the precise line-level split: exact surviving AI lines remain AI, replaced lines remain unattributed/non-AI.

Performance impact

  • Adds one logical-line diff per rewritten commit/file pair that has Git diff hunks and an authorship note.
  • It is bounded to hunked attributed paths only, not every file in the commit or worktree.
  • It reuses already-read source notes and the existing batched note write path, so there is no extra note read/write pass.
  • It reads immutable commit blobs only, using source and destination paths from diff-tree, including renames. No live worktree reads.

Validation

  • task fmt
  • task lint
  • task test TEST_FILTER=regular_rebase_with_conflict_preserves_ai_notes NO_CAPTURE=true
  • task test TEST_FILTER=regular_rebase_conflict NO_CAPTURE=true
  • task test TEST_FILTER=pull_rebase_ff NO_CAPTURE=true
  • task test TEST_FILTER=human_conflict NO_CAPTURE=true
  • task test TEST_FILTER=rebase NO_CAPTURE=true
  • task test
  • git diff --check

@svarlamov svarlamov force-pushed the feat/rebase-conflict-resolution-attribution branch from 8ee8ac7 to fc8a1cf Compare June 5, 2026 17:10
@svarlamov svarlamov force-pushed the feat/rebase-logical-line-recovery branch from 997af7b to 23a2603 Compare June 5, 2026 17:10
@svarlamov svarlamov force-pushed the feat/rebase-conflict-resolution-attribution branch from fc8a1cf to bc55e1e Compare June 5, 2026 18:40
@svarlamov svarlamov force-pushed the feat/rebase-logical-line-recovery branch from 23a2603 to 3b6ae62 Compare June 5, 2026 18:41
@svarlamov svarlamov force-pushed the feat/rebase-conflict-resolution-attribution branch from bc55e1e to 373f2bf Compare June 5, 2026 18:55
@svarlamov svarlamov force-pushed the feat/rebase-logical-line-recovery branch from 3b6ae62 to 61b4c2d Compare June 5, 2026 18:55
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