Skip to content

Local rewrites for authorship #69

Merged
acunniffe merged 13 commits intomainfrom
feat/local-rewrites-authorship
Oct 4, 2025
Merged

Local rewrites for authorship #69
acunniffe merged 13 commits intomainfrom
feat/local-rewrites-authorship

Conversation

@acunniffe
Copy link
Copy Markdown
Collaborator

@acunniffe acunniffe commented Oct 4, 2025

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

Comment thread src/git/cli_parser.rs
/// - `git merge abc --squash` => pos_command(0) returns Some("abc")
/// - `git merge --squash --no-verify abc` => pos_command(0) returns Some("abc")
/// - `git merge abc def --squash` => pos_command(1) returns Some("def")
pub fn pos_command(&self, n: u8) -> Option<String> {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@svarlamov trying to support parsing positional arguments

git merge feat/abc --squash
git merge --squash --other-flag feat/abc --flag-after-that

post_command(0) // always "feat/abc"

Does it look right?

@acunniffe acunniffe merged commit 4505339 into main Oct 4, 2025
3 checks passed
@acunniffe acunniffe deleted the feat/local-rewrites-authorship branch October 4, 2025 17:31
@acunniffe acunniffe restored the feat/local-rewrites-authorship branch October 5, 2025 19:42
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