Skip to content

fix: keep squash attribution on changed paths - #2497

Open
XSY-28 wants to merge 1 commit into
git-ai-project:mainfrom
XSY-28:codex/squash-changed-paths
Open

XSY-28 wants to merge 1 commit into
git-ai-project:mainfrom
XSY-28:codex/squash-changed-paths

Conversation

@XSY-28

@XSY-28 XSY-28 commented Nov 25, 2026 •

Copy link
Copy Markdown

Fixes #2475.

When a feature branch deletes a file and later merges an identical file from the base branch, Git's rename detection can pair those two paths. A squash commit then records the deleted file's attribution under the incoming path, even though that path is unchanged relative to the squash commit's parent.

Keep source attestations on the paths changed by the squash commit after shifting them into the final tree. Attribution for a genuine rename and attribution recorded during squash conflict resolution continue through their existing paths.

Verification

  • Replayed a real Git branch graph and git-ai ci local merge with local fixtures. The original note contained renamed.txt and the unchanged incoming.txt. The patched note contains only renamed.txt, and line attribution still credits the genuine rename.
  • 74 distinct local squash and CI rewrite tests passed on macOS arm64. The suite skipped one hosted GitHub test by design. Rust 1.93 formatting and all-target Clippy with warnings denied passed.

Prepared with OpenAI Codex (GPT-6.2 Sol, xhigh, standard service tier).


Devin Review

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

This branch has not been deployed

No deployments
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.

A squash copy moves a deleted file's credit onto an identical file the branch merged in

2 participants