git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* signed-off-by not overwritten with GIT_AUTHOR_NAME...?
@ 2021-04-07 13:42 Matthias Beyer
  2021-04-07 13:54 ` Taylor Blau
  0 siblings, 1 reply; 3+ messages in thread
From: Matthias Beyer @ 2021-04-07 13:42 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 768 bytes --]

Hi,

I just found that overwriting the GIT_AUTHOR_EMAIL and GIT_AUTHOR_NAME env
variables does alter the author when committing, but does not overwrite the
--signoff entry. Is this intentional?

To reproduce:

    cd /tmp
    mkdir foo
    cd foo
    git init
    touch foo
    git add foo
    GIT_AUTHOR_EMAIL=nobody@nomail.de GIT_AUTHOR_NAME="Someone Else" git commit -s -m test
    git show


I'm tested this for 2.29.3 and 2.29.2.

The manpage (2.29.3) does not say anything related to that under the `--signoff`
entry, nor under the `COMMIT INFORMATION` section!

If this is a bug, I'd love to contribute a patch, if someone can take my hand
and guide me to the right places!

Please keep me in CC, I'm not subscribed.

-- 
Matthias

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: signed-off-by not overwritten with GIT_AUTHOR_NAME...?
  2021-04-07 13:42 signed-off-by not overwritten with GIT_AUTHOR_NAME...? Matthias Beyer
@ 2021-04-07 13:54 ` Taylor Blau
  2021-04-07 14:00   ` Matthias Beyer
  0 siblings, 1 reply; 3+ messages in thread
From: Taylor Blau @ 2021-04-07 13:54 UTC (permalink / raw)
  To: Matthias Beyer; +Cc: git

On Wed, Apr 07, 2021 at 03:42:01PM +0200, Matthias Beyer wrote:
> Hi,
>
> I just found that overwriting the GIT_AUTHOR_EMAIL and GIT_AUTHOR_NAME env
> variables does alter the author when committing, but does not overwrite the
> --signoff entry. Is this intentional?

It is intentional. The identity used for signoff is the committer's, not
the author's. The documentation for `--signoff` in git-commit(1) says
(emphasis mine):

  [...] it typically certifies that *committer* has the rights to submit
  this work

And indeed 'sequencer.c:append_signoff()' calls 'fmt_name()' with
WANT_COMMITTER_IDENT, not WANT_AUTHOR_IDENT.

> To reproduce:
>
>     cd /tmp
>     mkdir foo
>     cd foo
>     git init
>     touch foo
>     git add foo
>     GIT_AUTHOR_EMAIL=nobody@nomail.de GIT_AUTHOR_NAME="Someone Else" git commit -s -m test
>     git show
>

All of the above is to say that if you s/AUTHOR/COMMITTER in your
example above, it will do what you expect.

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: signed-off-by not overwritten with GIT_AUTHOR_NAME...?
  2021-04-07 13:54 ` Taylor Blau
@ 2021-04-07 14:00   ` Matthias Beyer
  0 siblings, 0 replies; 3+ messages in thread
From: Matthias Beyer @ 2021-04-07 14:00 UTC (permalink / raw)
  To: Taylor Blau; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 181 bytes --]

On 07-04-2021 09:54:20, Taylor Blau wrote:
> [...] if you s/AUTHOR/COMMITTER in your example above, it will do what you
> expect.

Ah, awsome! Thanks for the explanation!

Matthias

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-07 14:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07 13:42 signed-off-by not overwritten with GIT_AUTHOR_NAME...? Matthias Beyer
2021-04-07 13:54 ` Taylor Blau
2021-04-07 14:00   ` Matthias Beyer

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git