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

Re: git-update-ref (reflog) uses bogus author ident information

From
Shawn Pearce <spearce@spearce.org>
Date
Jul 11, 2006, 00:32 UTC
Message-ID
<20060711003228.GC10700@spearce.org>
In-Reply-To
<20060711002754.GB10700@spearce.org>
Shawn Pearce <spearce@spearce.org> wrote:
Show 10 quoted lines
> Allow user.name and user.email to drive reflog entry.
> 
> Apparently calling setup_ident() after git_config causes the
> user.name and user.email values read from the config file to be
> replaced with the data obtained from the host.  This means that
> users who have setup their email address in user.email will instead
> be writing reflog entries with their hostname.
> 
> Moving setup_ident() to before git_config in update-ref resolves
> this ordering problem.
Whoops, I forgot this line:  :-)
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Show 31 quoted lines
> ---
>  builtin-update-ref.c |    1 +
>  refs.c               |    1 -
>  2 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/builtin-update-ref.c b/builtin-update-ref.c
> index 00333c7..83094ab 100644
> --- a/builtin-update-ref.c
> +++ b/builtin-update-ref.c
> @@ -12,6 +12,7 @@ int cmd_update_ref(int argc, const char 
>  	unsigned char sha1[20], oldsha1[20];
>  	int i;
>  
> +	setup_ident();
>  	setup_git_directory();
>  	git_config(git_default_config);
>  
> diff --git a/refs.c b/refs.c
> index 2d9c1dc..56db394 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -379,7 +379,6 @@ static int log_ref_write(struct ref_lock
>  			lock->log_file, strerror(errno));
>  	}
>  
> -	setup_ident();
>  	committer = git_committer_info(1);
>  	if (msg) {
>  		maxlen = strlen(committer) + strlen(msg) + 2*40 + 5;
> -- 
> 1.4.1.gc48f
Previous: Shawn Pearce
Message 6 of 6 in “git-update-ref (reflog) uses bogus author ident information”
  1. Jakub NarebskiJul 10, 2006
  2. reflog doesn't note that commit was --amend-ed, and doesn't record pullsJakub Narebski, Jul 10, 2006
  3. Shawn PearceJul 11, 2006
  4. Shawn PearceJul 11, 2006
  5. Shawn PearceJul 11, 2006
  6. Shawn PearceJul 11, 2006

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.