[PR #187] [MERGED] Fix saved stats in authorship #316

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

📋 Pull Request Information

Original PR: https://github.com/git-ai-project/git-ai/pull/187
Author: @acunniffe
Created: 11/5/2025
Status: Merged
Merged: 11/6/2025
Merged by: @acunniffe

Base: mainHead: fix/authorship-saved-stats


📝 Commits (10+)

📊 Changes

13 files changed (+1108 additions, -444 deletions)

View changed files

📝 src/authorship/authorship_log.rs (+79 -0)
📝 src/authorship/post_commit.rs (+9 -5)
📝 src/authorship/range_authorship.rs (+161 -226)
📝 src/authorship/rebase_authorship.rs (+77 -42)
📝 src/authorship/stats.rs (+32 -18)
📝 src/authorship/virtual_attribution.rs (+377 -104)
📝 src/commands/stats_delta.rs (+8 -4)
📝 src/git/repo_storage.rs (+32 -4)
📝 src/git/repository.rs (+114 -6)
📝 tests/amend.rs (+29 -29)
📝 tests/cherry_pick.rs (+117 -0)
📝 tests/repos/test_repo.rs (+5 -0)
📝 tests/squash_merge.rs (+68 -6)

📄 Description

  • Temporarily 0-out dep mixed for rewrite and mark as a known limitation in docs
  • Update merge favoring code to pick latest prompt version and sum total stats
  • Fixed Staged / Unstaged regression after 1.16 that was breaking amend and local squash use cases by bringing back coordinate conversion code
  • Filter foreign prompts with no contributions from prompts: {}
  • Make Range authorship work off of a squash (without updating authorship). This should make it accurate / aligned with the outputs from stats. Range stats == squash same range stats
  • Verified that no attribution prompts are not filtered out of authorship logs
  • Verified that authorship shas don't copy over every new log. Foreign prompts excluded

🔄 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/187 **Author:** [@acunniffe](https://github.com/acunniffe) **Created:** 11/5/2025 **Status:** ✅ Merged **Merged:** 11/6/2025 **Merged by:** [@acunniffe](https://github.com/acunniffe) **Base:** `main` ← **Head:** `fix/authorship-saved-stats` --- ### 📝 Commits (10+) - [`bb036c7`](https://github.com/git-ai-project/git-ai/commit/bb036c7954212ad6370eca77d95a5f219d32f2ab) prompt sorting - [`703a4da`](https://github.com/git-ai-project/git-ai/commit/703a4dabd6304343111050623a5b7de13cdb9e01) wip - [`1570d08`](https://github.com/git-ai-project/git-ai/commit/1570d0853ae8636ca127af1b72148898778cb1fc) filter out lines - [`104f4ef`](https://github.com/git-ai-project/git-ai/commit/104f4ef3ad1a1f90d68e4fd1d94ad8a49361012f) use coordinates - [`00a6994`](https://github.com/git-ai-project/git-ai/commit/00a69941733e41c83f0d6660990dc91b5972937b) simple additions done - [`bc95b1b`](https://github.com/git-ai-project/git-ai/commit/bc95b1b1e7130bb6a414d05dffc9ed7975e6e119) most passing - [`4661cdb`](https://github.com/git-ai-project/git-ai/commit/4661cdba2f38c7e3f22f15df60f827acb0dc13a7) working - [`a18f608`](https://github.com/git-ai-project/git-ai/commit/a18f608a5e7ab19374bd383c04a7bccecad82730) look at edited files in checkpoints - [`fedaa5c`](https://github.com/git-ai-project/git-ai/commit/fedaa5c086542fed16fbddc10e54c5e0904737ba) mostly fixed - [`685d285`](https://github.com/git-ai-project/git-ai/commit/685d285c241973b2ff09fadb5fa852373018ab36) fix inclusive hunk ranges ### 📊 Changes **13 files changed** (+1108 additions, -444 deletions) <details> <summary>View changed files</summary> 📝 `src/authorship/authorship_log.rs` (+79 -0) 📝 `src/authorship/post_commit.rs` (+9 -5) 📝 `src/authorship/range_authorship.rs` (+161 -226) 📝 `src/authorship/rebase_authorship.rs` (+77 -42) 📝 `src/authorship/stats.rs` (+32 -18) 📝 `src/authorship/virtual_attribution.rs` (+377 -104) 📝 `src/commands/stats_delta.rs` (+8 -4) 📝 `src/git/repo_storage.rs` (+32 -4) 📝 `src/git/repository.rs` (+114 -6) 📝 `tests/amend.rs` (+29 -29) 📝 `tests/cherry_pick.rs` (+117 -0) 📝 `tests/repos/test_repo.rs` (+5 -0) 📝 `tests/squash_merge.rs` (+68 -6) </details> ### 📄 Description - [x] Temporarily 0-out dep mixed for rewrite and mark as a known limitation in docs - [x] Update merge favoring code to pick latest prompt version and sum total stats - [x] Fixed Staged / Unstaged regression after 1.16 that was breaking amend and local squash use cases by bringing back coordinate conversion code - [x] Filter foreign prompts with no contributions from prompts: {} - [x] Make Range authorship work off of a squash (without updating authorship). This should make it accurate / aligned with the outputs from stats. Range stats == squash same range stats - [x] Verified that no attribution prompts are not filtered out of authorship logs - [x] Verified that authorship shas don't copy over every new log. Foreign prompts excluded --- <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:17 +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#316
No description provided.