threads / bug / 12027

[DOC BUG] git tag uses GIT_COMMITTER_DATE, not GIT_AUTHOR_DATE

Subject: [DOC BUG] git tag uses GIT_COMMITTER_DATE, not GIT_AUTHOR_DATE

## tl;dr

2 messages between Feb 11, 2008 and Feb 11, 2008.

replies: 1people: 2as markdown or json

Kalle Olavi Niemitalo· Feb 11, 2008, 08:38 UTC · lore
In Git v1.5.4.1, Documentation/git-tag.txt advises:
> To set the date used in future tag objects, set the environment
> variable GIT_AUTHOR_DATE to one or more of the date and time.  The
> date and time can be specified in a number of ways; the most common
> is "YYYY-MM-DD HH:MM".

But this does not work because git tag uses GIT_COMMITTER_DATE instead. In builtin-tag.c:

Show 9 quoted lines
> 	header_len = snprintf(header_buf, sizeof(header_buf),
> 			  "object %s\n"
> 			  "type %s\n"
> 			  "tag %s\n"
> 			  "tagger %s\n\n",
> 			  sha1_to_hex(object),
> 			  typename(type),
> 			  tag,
> 			  git_committer_info(IDENT_ERROR_ON_NO_NAME));
i.e. it does not call git_author_info.

The backdating section was added to git-tag.txt in 5040beff, and builtin-tag.c already used git_committer_info at that time. The older git-tag.sh used tagger=$(git-var GIT_COMMITTER_IDENT). Thus it seems the bug is in the documentation, not in the code.

Junio C Hamano· Feb 11, 2008, 09:09 UTC · re: Kalle Olavi Niemitalo · lore

Re: [DOC BUG] git tag uses GIT_COMMITTER_DATE, not GIT_AUTHOR_DATE

Kalle Olavi Niemitalo <kon@iki.fi> writes:
Show 26 quoted lines
> In Git v1.5.4.1, Documentation/git-tag.txt advises:
>
>> To set the date used in future tag objects, set the environment
>> variable GIT_AUTHOR_DATE to one or more of the date and time.  The
>> date and time can be specified in a number of ways; the most common
>> is "YYYY-MM-DD HH:MM".
>
> But this does not work because git tag uses GIT_COMMITTER_DATE instead.
> In builtin-tag.c:
>
>> 	header_len = snprintf(header_buf, sizeof(header_buf),
>> 			  "object %s\n"
>> 			  "type %s\n"
>> 			  "tag %s\n"
>> 			  "tagger %s\n\n",
>> 			  sha1_to_hex(object),
>> 			  typename(type),
>> 			  tag,
>> 			  git_committer_info(IDENT_ERROR_ON_NO_NAME));
>
> i.e. it does not call git_author_info.
>
> The backdating section was added to git-tag.txt in 5040beff,
> and builtin-tag.c already used git_committer_info at that time.
> The older git-tag.sh used tagger=$(git-var GIT_COMMITTER_IDENT).
> Thus it seems the bug is in the documentation, not in the code.

Correct. We've always used committer ident as far as I can remember.

← back to recent threads