Skip to content

Remove --author flag - #4

Merged
Bennyjitsu merged 2 commits into
mainfrom
remove-author-flag
Sep 20, 2026
Merged

Bennyjitsu merged 2 commits into
mainfrom
remove-author-flag

Conversation

@Bennyjitsu

Copy link
Copy Markdown
Owner

Why

The --author flag on wt merge/wt step commit/wt step squash was added
to 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_EMAIL from the environment on
every code path this flag touched — git commit, git commit-tree (the
--no-ff merge path), and squash's git commit — since nothing in wt
scrubs those vars from spawned children.

Verified live before removing: exported the env vars, ran wt step commit,
wt step squash, and wt merge --no-ff against 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_spec didn't match git commit --author's actual semantics (rejected pattern-lookup and Name <> forms
git accepts), and the same --author value was silently accepted on the
squash/commit path but rejected on the --no-ff commit-tree path — worth
fixing, but not worth fixing in code we don't need.

What changed

  • Removed the --author CLI flag from merge, step commit, step squash.
  • Removed split_author_spec and run_command_with_env (only consumer of
    each was this flag).
  • test_step_squash_failed_commit_restores_original_history loses its
    invalid---author failure injector (that path no longer exists) — a real
    .git/hooks/pre-commit exiting non-zero replaces it, firing at the same
    point (after the soft reset, since the squash commit doesn't pass
    --no-verify) and proving the same rollback behavior.
  • Removed the four --author-specific tests.
  • Regenerated docs, skill reference pages, and the Unix-only help snapshots
    (help.rs is #![cfg(not(windows))], regenerated via WSL2).

Full pre-merge gate green: cargo run -- hook pre-merge --yes — 4,934 tests
passed, clippy clean, doc-sync clean.

🤖 Generated with Claude Code

Claude and others added 2 commits September 20, 2026 17:17
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>
@Bennyjitsu
Bennyjitsu merged commit 62ad2ef into main Sep 20, 2026
22 of 23 checks passed
@Bennyjitsu
Bennyjitsu deleted the remove-author-flag branch September 23, 2026 12:22
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