[PR #69] [MERGED] Local rewrites for authorship #241

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

📋 Pull Request Information

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

Base: mainHead: feat/local-rewrites-authorship


📝 Commits (10+)

  • b737041 wip log
  • e165c5b got ammend events saving to log
  • 6916b0b get aligned w/ main
  • 3e56d03 borrow global args
  • 1b11cfb commit event added
  • fbcf300 commit events are saving
  • fc97cfa --amend working end-end
  • a47e1a7 non-resetable checkpoints
  • 8b9dc2f merge squash logic
  • a1ccfad added tests and fixes for a blame regression where we failed to remove parent from base before calling blame.

📊 Changes

22 files changed (+2568 additions, -235 deletions)

View changed files

📝 .gitignore (+1 -1)
📝 src/commands/commit_hooks.rs (+84 -45)
📝 src/commands/fetch_hooks.rs (+1 -1)
📝 src/commands/git_ai_handlers.rs (+2 -2)
📝 src/commands/git_handlers.rs (+93 -10)
📝 src/commands/push_hooks.rs (+1 -1)
📝 src/commands/rebase_authorship.rs (+665 -19)
src/commands/snapshots/git_ai__commands__rebase_authorship__tests__amend_add_lines_at_bottom.snap (+42 -0)
src/commands/snapshots/git_ai__commands__rebase_authorship__tests__amend_add_lines_at_top.snap (+42 -0)
src/commands/snapshots/git_ai__commands__rebase_authorship__tests__amend_add_lines_in_middle.snap (+42 -0)
src/commands/snapshots/git_ai__commands__rebase_authorship__tests__amend_multiple_changes.snap (+109 -0)
📝 src/commands/snapshots/git_ai__commands__rebase_authorship__tests__with_out_of_band_commits.snap (+28 -37)
📝 src/git/cli_parser.rs (+151 -0)
📝 src/git/mod.rs (+1 -0)
📝 src/git/post_commit.rs (+2 -1)
📝 src/git/repo_storage.rs (+25 -1)
📝 src/git/repository.rs (+41 -3)
src/git/rewrite_log.rs (+633 -0)
📝 src/git/test_utils/mod.rs (+75 -2)
📝 src/log_fmt/authorship_log_serialization.rs (+518 -112)

...and 2 more files

📄 Description

Rewrites authorship and working logs to support history rewriting operations.

Introduces patterns, rewirte_log and triggers off these commands

commit --amend
merge --squash
reset --hard


Next up in future PRs

  • revert
  • reset
  • cherrypick
  • rebase

Known issues

  • Better support for any ordering of merge, refname and --squash flags
  • Does not support multiple commits git merge [<options>] <commit>...

🔄 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/69 **Author:** [@acunniffe](https://github.com/acunniffe) **Created:** 10/4/2025 **Status:** ✅ Merged **Merged:** 10/4/2025 **Merged by:** [@acunniffe](https://github.com/acunniffe) **Base:** `main` ← **Head:** `feat/local-rewrites-authorship` --- ### 📝 Commits (10+) - [`b737041`](https://github.com/git-ai-project/git-ai/commit/b737041a6e2245a4cdbd1bfd026a61fb9d42a5c8) wip log - [`e165c5b`](https://github.com/git-ai-project/git-ai/commit/e165c5bd056d2e9a35f3d56fdb053a970e7fcba1) got ammend events saving to log - [`6916b0b`](https://github.com/git-ai-project/git-ai/commit/6916b0b2c112f7a88e74f7fffe810eb6f92df361) get aligned w/ main - [`3e56d03`](https://github.com/git-ai-project/git-ai/commit/3e56d03cac90e0b8abdf903f27695fd3784da7f3) borrow global args - [`1b11cfb`](https://github.com/git-ai-project/git-ai/commit/1b11cfb96818cb302894941602a8dc934230fd35) commit event added - [`fbcf300`](https://github.com/git-ai-project/git-ai/commit/fbcf3004c3ce252df8c83f51b9a2779e6ccb891f) commit events are saving - [`fc97cfa`](https://github.com/git-ai-project/git-ai/commit/fc97cfa23fd82e092ab27658fa8f5436ff0ffc67) --amend working end-end - [`a47e1a7`](https://github.com/git-ai-project/git-ai/commit/a47e1a716a253caf2fa8e0e4ff372e1c93804273) non-resetable checkpoints - [`8b9dc2f`](https://github.com/git-ai-project/git-ai/commit/8b9dc2fd381bc42a6c127662d0e5c6c763f3e56f) merge squash logic - [`a1ccfad`](https://github.com/git-ai-project/git-ai/commit/a1ccfad8e097e905f8b3a913684fb56d2003885a) added tests and fixes for a blame regression where we failed to remove parent from base before calling blame. ### 📊 Changes **22 files changed** (+2568 additions, -235 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -1) 📝 `src/commands/commit_hooks.rs` (+84 -45) 📝 `src/commands/fetch_hooks.rs` (+1 -1) 📝 `src/commands/git_ai_handlers.rs` (+2 -2) 📝 `src/commands/git_handlers.rs` (+93 -10) 📝 `src/commands/push_hooks.rs` (+1 -1) 📝 `src/commands/rebase_authorship.rs` (+665 -19) ➕ `src/commands/snapshots/git_ai__commands__rebase_authorship__tests__amend_add_lines_at_bottom.snap` (+42 -0) ➕ `src/commands/snapshots/git_ai__commands__rebase_authorship__tests__amend_add_lines_at_top.snap` (+42 -0) ➕ `src/commands/snapshots/git_ai__commands__rebase_authorship__tests__amend_add_lines_in_middle.snap` (+42 -0) ➕ `src/commands/snapshots/git_ai__commands__rebase_authorship__tests__amend_multiple_changes.snap` (+109 -0) 📝 `src/commands/snapshots/git_ai__commands__rebase_authorship__tests__with_out_of_band_commits.snap` (+28 -37) 📝 `src/git/cli_parser.rs` (+151 -0) 📝 `src/git/mod.rs` (+1 -0) 📝 `src/git/post_commit.rs` (+2 -1) 📝 `src/git/repo_storage.rs` (+25 -1) 📝 `src/git/repository.rs` (+41 -3) ➕ `src/git/rewrite_log.rs` (+633 -0) 📝 `src/git/test_utils/mod.rs` (+75 -2) 📝 `src/log_fmt/authorship_log_serialization.rs` (+518 -112) _...and 2 more files_ </details> ### 📄 Description Rewrites authorship and working logs to support history rewriting operations. Introduces patterns, `rewirte_log` and triggers off these commands `commit --amend` `merge --squash` `reset --hard` --- Next up in future PRs - revert - reset - cherrypick - rebase Known issues - [x] Better support for any ordering of merge, refname and `--squash` flags - [ ] Does not support multiple commits `git merge [<options>] <commit>...` --- <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:03 +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#241
No description provided.