git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Luke Dashjr <luke@dashjr.org>,
	git@vger.kernel.org
Subject: Re: GIT_COMMITTER_* and reflog
Date: Sun, 27 Oct 2019 21:20:24 +0900	[thread overview]
Message-ID: <xmqqr22ybcs7.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20191026173702.GA5522@sigill.intra.peff.net> (Jeff King's message of "Sat, 26 Oct 2019 13:37:02 -0400")

Jeff King <peff@peff.net> writes:

> If somebody wants to pursue a patch, I suspect the solution is probably
> something like this (totally untested):

Looks sensible.  It is very much unsatisfying that datestamp(),
which is used by fmt_ident() when no date string is given, seems to
totally bypass date.c::get_time(), which means the framework to give
fake timestamp via GIT_TEST_DATE_NOW cannot be used to write
reproducible tests.

Given that datestamp() is only used by the push certificate and
fast-import codepaths and nowhere else, I suspect that "fixing" it
retroactively to honor GIT_TEST_DATE_NOW would not have any negative
fallout, but that's not something I should be contemplating on
during the -rc period ;-)

Thanks.

>
> diff --git a/refs/files-backend.c b/refs/files-backend.c
> index d60767ab73..2ebf2feeb8 100644
> --- a/refs/files-backend.c
> +++ b/refs/files-backend.c
> @@ -1658,7 +1658,10 @@ static int files_log_ref_write(struct files_ref_store *refs,
>  	if (logfd < 0)
>  		return 0;
>  	result = log_ref_write_fd(logfd, old_oid, new_oid,
> -				  git_committer_info(0), msg);
> +				  fmt_ident(getenv("GIT_COMMITTER_NAME"),
> +					    getenv("GIT_COMMITTER_EMAIL"),
> +					    WANT_COMMITTER_IDENT, NULL, 0),
> +				  msg);
>  	if (result) {
>  		struct strbuf sb = STRBUF_INIT;
>  		int save_errno = errno;
>
> -Peff

  reply	other threads:[~2019-10-27 12:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25 21:49 GIT_COMMITTER_* and reflog Luke Dashjr
2019-10-26  2:20 ` Jonathan Nieder
2019-10-26  2:43   ` Luke Dashjr
2019-11-07 13:57     ` Philip Oakley
2019-10-26  7:34   ` Junio C Hamano
2019-10-26 17:37     ` Jeff King
2019-10-27 12:20       ` Junio C Hamano [this message]
2019-10-29 14:05         ` Phillip Wood
2019-10-29 14:34         ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqr22ybcs7.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=luke@dashjr.org \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).