Re: [PATCH] commit: add --committer option
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Nov 11, 2025, 13:19 UTC
- Message-ID
- <CAOLTT8RSvOoQyXeB6bxf68iX8_ptnsWALHhT8ztCYiR7ifue-Q@mail.gmail.com>
- In-Reply-To
- <xmqq7bvx3i0u.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2025年11月11日周二 01:38写道:
Show 25 quoted lines
> > Patrick Steinhardt <ps@pks.im> writes: > > > On Sun, Nov 09, 2025 at 10:22:54AM +0000, ZheNing Hu via GitGitGadget wrote: > >> From: ZheNing Hu <adlternative@gmail.com> > >> > >> Add --committer option to git-commit, allowing users to override the > >> committer identity similar to how --author works. This provides a more > >> convenient alternative to setting GIT_COMMITTER_* environment variables. > > > > Yeah, I can see how that's useful. > > Well, I don't. Naming somebody other than yourself as the author > may be something that is needed from time to time by human users, > but lying about the committer who made commits? Our tradition is to > give long rope to let users hang themselves, but we already have the > environment variable override specifically designed for scripted uses, > where there may be very legit uses of recording arbitrary committer > identity that has nothing to do with the identity the current user > who is running the Git processes usually uses. I do not think it is > a "useful" change to make it more it ergonomic to perform certain > operations that we may not want to encourage. > > So I dunno. >
I understand your concern about not wanting to encourage users to misrepresent their committer identity. However, I'd like to point out that if someone truly wants to "lie" about the committer identity, there's nothing stopping them today. They can already do this through multiple methods.
My primary motivation for this patch is not to make it easier to falsify identity, but rather to help legitimate users who work across different repositories with different identities. These users occasionally need to fix accidentally misconfigured committer information, and the current methods (setting environment variables or editing config files) can be cumbersome for this use case.
You can see from [1] how many people have struggled with modifying commits committer.
>
[1]: https://stackoverflow.com/questions/750172/how-do-i-change-the-author-and-committer-name-email-for-multiple-commits?page=1&tab=scoredesc#tab-top