git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: Should GIT_AUTHOR_{NAME,EMAIL} set the tagger name/email?
Date: Sat, 1 Sep 2012 17:34:12 +0200	[thread overview]
Message-ID: <CACBZZX7Ud8Xx225ss6SYqZFXyW0FG2XJimBWdvW_NuMqn8yOnA@mail.gmail.com> (raw)

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.

             reply	other threads:[~2012-09-01 15:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-01 15:34 Ævar Arnfjörð Bjarmason [this message]
2012-09-01 15:57 ` Should GIT_AUTHOR_{NAME,EMAIL} set the tagger name/email? Andreas Schwab
2012-09-01 16:06   ` Ævar Arnfjörð Bjarmason
2012-09-01 16:12     ` Andreas Schwab
2012-09-11 14:56       ` Ævar Arnfjörð Bjarmason
2012-09-11 16:53         ` Junio C Hamano
2012-09-11 16:58           ` demerphq

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACBZZX7Ud8Xx225ss6SYqZFXyW0FG2XJimBWdvW_NuMqn8yOnA@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).