git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: signed-off-by not overwritten with GIT_AUTHOR_NAME...?

From
Taylor Blau <me@ttaylorr.com>
Date
Apr 7, 2021, 13:54 UTC
Message-ID
<YG25jNZH9ATfwlMu@nand.local>
In-Reply-To
<20210407134201.kxijiev5sn346bsy@hoshi>
On Wed, Apr 07, 2021 at 03:42:01PM +0200, Matthias Beyer wrote:
Show 5 quoted lines
> 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.

Show 11 quoted lines
> 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

Previous: Matthias BeyerNext: Matthias Beyer
Message 2 of 3 in “signed-off-by not overwritten with GIT_AUTHOR_NAME...?”
  1. Matthias BeyerApr 7, 2021
  2. Taylor BlauApr 7, 2021
  3. Matthias BeyerApr 7, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.