Re: [PATCH] commit: add --committer option
Jeff King <peff@peff.net> 于2025年11月12日周三 06:23写道:
Show 24 quoted lines
>
> On Tue, Nov 11, 2025 at 01:58:21PM -0800, Junio C Hamano wrote:
>
> > Jeff King <peff@peff.net> writes:
> >
> > > I just mean being able to do:
> > >
> > > git commit --amend --author='Foo Bar <foo@example.com>' --committer-is-author
> > >
> > > instead of:
> > >
> > > git commit --amend --author='Foo Bar <foo@example.com>' --committer='Foo Bar <foo@example.com>'
> >
> > Ah, I see. Like
> >
> > git -c user.name='Foo Bar' -c user.email=foo@example.com commit --amend
> >
> > Makes me wonder if we want user.ident that covers them both ;-)
>
> Hmm, I hadn't thought to use "-c" config for this. That makes me
> question the utility of --committer a little bit. ;) I guess it is
> slightly more convenient than "-c" in that it will trigger the
> find_author_by_nickname() magic.
>
The advantages of --committer over -c user.name -c user.email:
1. It's symmetric with --author
2. A single option is sufficient
3. As you mentioned, it can search for the committer in commit
history (although that wasn't my original intention)
> -Peff