Re: [PATCH] commit: add --committer option
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Nov 17, 2025, 15:06 UTC
- Message-ID
- <CAOLTT8SEwipDtthO2T0CkE5-rCJdq9oDjTKcBEH2YxzpjAM9jQ@mail.gmail.com>
- In-Reply-To
- <xmqqfraeeqgw.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2025年11月16日周日 09:06写道:
Show 24 quoted lines
> > ZheNing Hu <adlternative@gmail.com> writes: > > >> 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. > > I do not think it is about design philosophy at all, though. > > The distinction comes from the difference between what "author" and > "committer" fields record. The committer records the identity of > the person who was at the keyboard when the commit object was > created. The author records the identity of the person who wrote > the change that the committer is turning into a commit. There is no > symmetry between them, hence there is no inconsistency here. >
I understand the difference between committer and author, but some regular Git users don't really pay much attention to the distinction between the two. For these users, being able to quickly and easily correct user information is sufficient — it's just that some previous solutions were a bit complicated.
Show 12 quoted lines
> And it also comes from the actual human user behaviour. > > Many authors can pass their patches to a smaller number of > committers who make them into part of the official project history, > so when a commit is made, there is much stronger need to tweak who > the author is for the commit than to tweak who the committer is. On > the other hand, it is rare (if ever done) for multiple committers to > share a single shell terminal session and take turns to make commit, > where you would need to be able to say "this invocations of 'git > commit' command is done by person X, who is different from the one > who made the previous commit in this same shell session". >
Yes, I believe users in this case are very rare. As I mentioned before, I just want to help those users who want to fix things after misconfiguration, making the fix a bit simpler.