Re: [PATCH] commit: add --committer option
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Nov 15, 2025, 05:29 UTC
- Message-ID
- <CAOLTT8RSN-72gVXDS-zrr=7wW4HU=CL6acyDx_UXnvo4c5MaRA@mail.gmail.com>
- In-Reply-To
- <xmqqqzu3qi43.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2025年11月13日周四 01:24写道:
Show 25 quoted lines
>
> ZheNing Hu <adlternative@gmail.com> writes:
>
> >> I'm afraid I don't quite follow. If you are amending existing commits to
> >> fix them up after you have corrected your configuration then they will
> >> have the correct committer automatically when you run "git commit
> >> --amend --author=..." to correct the author. If you are committing
> >> before you have realized that user.{name,email} are misconfigured then I
> >> don't see how "--committer" helps because you have not yet realized
> >> anything is wrong.
> >>
> >
> > You're right that after realizing the misconfiguration and correcting the
> > repository's user.name and user.email, running `git commit --amend` will
> > fix the committer information, but the author remains unchanged. Users
> > then need an additional `git commit --amend --author=...` to fix the author,
> > which does work but requires an extra step.
>
> Isn't it more like "You need to run with --author to correct the
> authorship by amending the commit *anyway*, but while doing so, the
> committer information will automatically be corrected"? As I said
> earlier in a separate message, the author and the committer are not
> symmetric, so having "--author" does make sense in the above picture,
> while "--committer", as Phillip points out, much less.
>Well, I admit that perhaps the design philosophy of author/committer is inconsistent (which has caused too much trouble), but for users, a consistent parameter interface is easier to understand and use.