[PR #57] [MERGED] Fixed ai-blame logic for overlapping commits #231

Closed
opened 2026-03-02 04:13:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/git-ai-project/git-ai/pull/57
Author: @acunniffe
Created: 10/1/2025
Status: Merged
Merged: 10/1/2025
Merged by: @acunniffe

Base: mainHead: fix/ai-blame


📝 Commits (1)

📊 Changes

21 files changed (+578 additions, -22 deletions)

View changed files

📝 src/commands/blame.rs (+18 -6)
📝 src/log_fmt/authorship_log_serialization.rs (+36 -5)
📝 src/tmp_repo.rs (+7 -4)
📝 tests/simple_additions.rs (+199 -2)
📝 tests/snapshots/simple_additions__ai_adds_lines_and_human_deletes_most_of_them-2.snap (+1 -0)
📝 tests/snapshots/simple_additions__ai_adds_lines_and_human_deletes_most_of_them.snap (+2 -2)
tests/snapshots/simple_additions__ai_human_interleaved_line_attribution-2.snap (+11 -0)
tests/snapshots/simple_additions__ai_human_interleaved_line_attribution.snap (+45 -0)
📝 tests/snapshots/simple_additions__ai_prepending_lines.snap (+2 -1)
📝 tests/snapshots/simple_additions__complex_mixed_additions_and_deletions.snap (+4 -2)
tests/snapshots/simple_additions__duplicate_prompt_entries_bug-2.snap (+14 -0)
tests/snapshots/simple_additions__duplicate_prompt_entries_bug.snap (+46 -0)
📝 tests/snapshots/simple_additions__human_adds_then_ai_modifies_then_human_deletes.snap (+1 -0)
📝 tests/snapshots/simple_additions__multiple_ai_checkpoints_with_human_deletions.snap (+1 -0)
tests/snapshots/simple_additions__multiple_overwrites_at_bottom-2.snap (+8 -0)
tests/snapshots/simple_additions__multiple_overwrites_at_bottom.snap (+41 -0)
tests/snapshots/simple_additions__multiple_overwrites_at_top-2.snap (+8 -0)
tests/snapshots/simple_additions__multiple_overwrites_at_top.snap (+41 -0)
tests/snapshots/simple_additions__multiple_overwrites_in_middle-2.snap (+10 -0)
tests/snapshots/simple_additions__multiple_overwrites_in_middle.snap (+41 -0)

...and 1 more files

📄 Description

Overlapping changes with line deletions were causing misattribution. This is separate from the working log -> authorship shift issue addressed in https://github.com/acunniffe/git-ai/pull/47

Refined logic and added more tests

Previous authorship logs are still valid (no need to delete), they were just not being processed correctly.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/git-ai-project/git-ai/pull/57 **Author:** [@acunniffe](https://github.com/acunniffe) **Created:** 10/1/2025 **Status:** ✅ Merged **Merged:** 10/1/2025 **Merged by:** [@acunniffe](https://github.com/acunniffe) **Base:** `main` ← **Head:** `fix/ai-blame` --- ### 📝 Commits (1) - [`efeeb88`](https://github.com/git-ai-project/git-ai/commit/efeeb88f5e9e127860c8c4fbfe4a25220eaae955) ai-blame fixes ### 📊 Changes **21 files changed** (+578 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/commands/blame.rs` (+18 -6) 📝 `src/log_fmt/authorship_log_serialization.rs` (+36 -5) 📝 `src/tmp_repo.rs` (+7 -4) 📝 `tests/simple_additions.rs` (+199 -2) 📝 `tests/snapshots/simple_additions__ai_adds_lines_and_human_deletes_most_of_them-2.snap` (+1 -0) 📝 `tests/snapshots/simple_additions__ai_adds_lines_and_human_deletes_most_of_them.snap` (+2 -2) ➕ `tests/snapshots/simple_additions__ai_human_interleaved_line_attribution-2.snap` (+11 -0) ➕ `tests/snapshots/simple_additions__ai_human_interleaved_line_attribution.snap` (+45 -0) 📝 `tests/snapshots/simple_additions__ai_prepending_lines.snap` (+2 -1) 📝 `tests/snapshots/simple_additions__complex_mixed_additions_and_deletions.snap` (+4 -2) ➕ `tests/snapshots/simple_additions__duplicate_prompt_entries_bug-2.snap` (+14 -0) ➕ `tests/snapshots/simple_additions__duplicate_prompt_entries_bug.snap` (+46 -0) 📝 `tests/snapshots/simple_additions__human_adds_then_ai_modifies_then_human_deletes.snap` (+1 -0) 📝 `tests/snapshots/simple_additions__multiple_ai_checkpoints_with_human_deletions.snap` (+1 -0) ➕ `tests/snapshots/simple_additions__multiple_overwrites_at_bottom-2.snap` (+8 -0) ➕ `tests/snapshots/simple_additions__multiple_overwrites_at_bottom.snap` (+41 -0) ➕ `tests/snapshots/simple_additions__multiple_overwrites_at_top-2.snap` (+8 -0) ➕ `tests/snapshots/simple_additions__multiple_overwrites_at_top.snap` (+41 -0) ➕ `tests/snapshots/simple_additions__multiple_overwrites_in_middle-2.snap` (+10 -0) ➕ `tests/snapshots/simple_additions__multiple_overwrites_in_middle.snap` (+41 -0) _...and 1 more files_ </details> ### 📄 Description Overlapping changes with line deletions were causing misattribution. This is separate from the working log -> authorship shift issue addressed in https://github.com/acunniffe/git-ai/pull/47 Refined logic and added more tests Previous authorship logs are still valid (no need to delete), they were just not being processed correctly. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:13:01 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#231
No description provided.