Repository navigation
Remove --author flag - #4
Merged
Merged
Conversation
GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL env vars already propagate through every commit path this flag touched (git commit, commit-tree via env, squash) with no code needed, since none of them scrub the environment. Verified live against a build with this flag against all three commit paths (step commit, step squash, merge --no-ff) before removing it. The flag also had a correctness bug: its author-spec parser didn't match real `git commit --author` semantics (rejected pattern-lookup and `Name <>` forms git accepts), and the same value was silently accepted on the squash/commit path but rejected on the --no-ff commit-tree path. Drops split_author_spec, run_command_with_env, and the four dedicated --author tests. test_step_squash_failed_commit_restores_original_history loses its --author-based failure injector (a real .git/hooks/pre-commit exiting non-zero replaces it, firing at the same point post-reset). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Unix-only (help.rs is #![cfg(not(windows))]); regenerated via WSL2. Full pre-merge gate (4934 tests, clippy, doc sync) green. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
--authorflag onwt merge/wt step commit/wt step squashwas addedto forward explicit commit authorship (our own policy: an AI agent must never
commit under the default identity). It turned out to be unnecessary: git
already reads
GIT_AUTHOR_NAME/GIT_AUTHOR_EMAILfrom the environment onevery code path this flag touched —
git commit,git commit-tree(the--no-ffmerge path), and squash'sgit commit— since nothing inwtscrubs those vars from spawned children.
Verified live before removing: exported the env vars, ran
wt step commit,wt step squash, andwt merge --no-ffagainst a real build with the flag,and confirmed each resulting commit's author was set correctly with the
committer left ambient — the same split the flag's own docs promised.
The flag also had a real bug:
split_author_specdidn't matchgit commit --author's actual semantics (rejected pattern-lookup andName <>formsgit accepts), and the same
--authorvalue was silently accepted on thesquash/commit path but rejected on the
--no-ffcommit-tree path — worthfixing, but not worth fixing in code we don't need.
What changed
--authorCLI flag frommerge,step commit,step squash.split_author_specandrun_command_with_env(only consumer ofeach was this flag).
test_step_squash_failed_commit_restores_original_historyloses itsinvalid-
--authorfailure injector (that path no longer exists) — a real.git/hooks/pre-commitexiting non-zero replaces it, firing at the samepoint (after the soft reset, since the squash commit doesn't pass
--no-verify) and proving the same rollback behavior.--author-specific tests.(
help.rsis#![cfg(not(windows))], regenerated via WSL2).Full pre-merge gate green:
cargo run -- hook pre-merge --yes— 4,934 testspassed, clippy clean, doc-sync clean.
🤖 Generated with Claude Code