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

Should GIT_AUTHOR_{NAME,EMAIL} set the tagger name/email?

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 1, 2012, 15:34 UTC
Message-ID
<CACBZZX7Ud8Xx225ss6SYqZFXyW0FG2XJimBWdvW_NuMqn8yOnA@mail.gmail.com>

Maybe this is documented in some place I didn't spot, but I expected that when I set GIT_AUTHOR_{NAME,EMAIL} it would affect the operation of git-tag, but it doesn't seem to. When I create tags it seems to completely ignore those variables.

Should it be doing that? Here's a test script demonstrating the issue:
    #!/bin/sh -e
    # Set defaults
    git config --global user.name "Ævar Arnfjörð Bjarmason"
    git config --global user.email "avarab@gmail.com"
    rm -rf /tmp/test-git
    git init /tmp/test-git
    cd /tmp/test-git
    make_commit() {
        file=$1
        content=$2
        echo $content >$file
        git add $file
        git commit -m"$file: $content" $file
        git --no-pager log -1 HEAD | grep ^Author
    }
    make_commit README "testing content"
    git config user.name "Test User"
    git config user.email "test@example.com"
    make_commit README "testing content again"
    git tag -a -m"annotated tag" tag-name-1
    git --no-pager show tag-name-1 | grep ^Author
    GIT_AUTHOR_NAME="Tag Test User"
GIT_AUTHOR_EMAIL="tagtest@example.com" git tag -a -m"another annotated
tag" tag-name-2
    git --no-pager show tag-name-2 | grep ^Author
Which outputs:
    $ sh /tmp/test-tag.sh
    Initialized empty Git repository in /tmp/test-git/.git/
    [master (root-commit) 9816756] README: testing content
     1 file changed, 1 insertion(+)
     create mode 100644 README
    Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    [master 304b71e] README: testing content again
     1 file changed, 1 insertion(+), 1 deletion(-)
    Author: Test User <test@example.com>
    Author: Test User <test@example.com>
    Author: Test User <test@example.com>

I'd expect references to "Tag Test User <tagtest@example.com>" for the second tag I created.

Next: Andreas Schwab
Message 1 of 7 in “Should GIT_AUTHOR_{NAME,EMAIL} set the tagger name/email?”
  1. Ævar Arnfjörð BjarmasonSep 1, 2012
  2. Andreas SchwabSep 1, 2012
  3. Ævar Arnfjörð BjarmasonSep 1, 2012
  4. Andreas SchwabSep 1, 2012
  5. Ævar Arnfjörð BjarmasonSep 11, 2012
  6. Junio C HamanoSep 11, 2012
  7. demerphqSep 11, 2012

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.