git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jeff King <peff@peff.net>
Cc: VenomVendor <info@venomvendor.com>,
	Junio C Hamano <gitster@pobox.com>,
	Phillip Wood <phillip.wood@dunelm.org.uk>,
	git@vger.kernel.org
Subject: Re: [PATCH 4/3] am, sequencer: stop parsing our own committer ident
Date: Mon, 26 Oct 2020 17:25:01 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2010261722230.56@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20201023074510.GB2918369@coredump.intra.peff.net>

Hi Peff,

On Fri, 23 Oct 2020, Jeff King wrote:

> diff --git a/ident.c b/ident.c
> index 6aba4b5cb6..7743c1ed05 100644
> --- a/ident.c
> +++ b/ident.c
> @@ -384,6 +384,12 @@ const char *fmt_ident(const char *name, const char *email,
>  	struct strbuf *ident = &ident_pool[index];
>  	index = (index + 1) % ARRAY_SIZE(ident_pool);
>
> +	if (!email) {
> +		if (whose_ident == WANT_AUTHOR_IDENT)
> +			email = getenv("GIT_AUTHOR_EMAIL");
> +		else if (whose_ident == WANT_COMMITTER_IDENT)
> +			email = getenv("GIT_COMMITTER_EMAIL");

I *guess* that this is a strict improvement, calling `getenv()` much
closer to the time the value is actually used (and hence avoiding the
problem where pointers returned by `getenv()` get stale due to environment
changes).

Thanks,
Dscho

  parent reply	other threads:[~2020-10-26 16:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23  5:48 committer-date-is-author-date flag removes email in "Commit" VenomVendor
2020-10-23  7:07 ` Jeff King
2020-10-23  7:08   ` [PATCH 1/3] t3436: check --committer-date-is-author-date result more carefully Jeff King
2020-10-23 10:10     ` Phillip Wood
2020-10-23  7:09   ` [PATCH 2/3] am: fix broken email with --committer-date-is-author-date Jeff King
2020-10-23  7:26     ` [PATCH 4/3] am, sequencer: stop parsing our own committer ident Jeff King
2020-10-23  7:45       ` Jeff King
2020-10-23 17:29         ` Taylor Blau
2020-10-26 16:25         ` Johannes Schindelin [this message]
2020-10-27  7:23           ` Jeff King
2020-10-23 14:06       ` Phillip Wood
2020-10-26 17:12       ` Junio C Hamano
2020-10-27  7:24         ` Jeff King
2020-10-23  7:10   ` [PATCH 3/3] rebase: fix broken email with --committer-date-is-author-date Jeff King
2020-10-23 15:23   ` committer-date-is-author-date flag removes email in "Commit" Junio C Hamano
2020-10-23 17:32     ` Phillip Wood
2020-10-23 17:59       ` Junio C Hamano

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=nycvar.QRO.7.76.6.2010261722230.56@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=info@venomvendor.com \
    --cc=peff@peff.net \
    --cc=phillip.wood@dunelm.org.uk \
    /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).