From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Phillip Wood <phillip.wood@dunelm.org.uk>
Cc: Elijah Newren <newren@gmail.com>,
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
Git Mailing List <git@vger.kernel.org>,
Jonathan Nieder <jrnieder@gmail.com>,
Paul Gevers <elbrus@debian.org>,
Ian Jackson <ijackson@chiark.greenend.org.uk>,
Alban Gruin <alban.gruin@gmail.com>
Subject: Re: [PATCH] sequencer: honor GIT_REFLOG_ACTION
Date: Tue, 7 Apr 2020 16:50:17 +0200 (CEST) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.2004071649190.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <09397e37-a22b-5159-b760-bae238ae3ed6@gmail.com>
Hi,
On Thu, 2 Apr 2020, Phillip Wood wrote:
> On 02/04/2020 18:01, Elijah Newren wrote:
> >
> > On Thu, Apr 2, 2020 at 2:25 AM Phillip Wood <phillip.wood123@gmail.com>
> > wrote:
> > >
> > > On 01/04/2020 21:31, Elijah Newren via GitGitGadget wrote:
> > >
> > > > va_start(ap, fmt);
> > > > strbuf_reset(&buf);
> > > > - strbuf_addstr(&buf, action_name(opts));
> > > > + strbuf_addstr(&buf, reflog_action ? reflog_action :
> > > > action_name(opts));
> > > > if (sub_action)
> > > > strbuf_addf(&buf, " (%s)", sub_action);
> > > > if (fmt) {
> > > > @@ -3799,8 +3800,10 @@ static int pick_commits(struct repository *r,
> > > > struct replay_opts *opts)
> > > > {
> > > > int res = 0, reschedule = 0;
> > > > + char *prev_reflog_action;
> > > >
> > > > setenv(GIT_REFLOG_ACTION, action_name(opts), 0);
> > > > + prev_reflog_action = xstrdup(getenv(GIT_REFLOG_ACTION));
> > >
> > > I'm confused as to why saving the environment variable immediately after
> > > setting it works but the test shows it does - why doesn't this clobber
> > > the value of GIT_REFLOG_ACTION set by the user?
> >
> > The third parameter, 0, means only set the environment variable if
> > it's not already set.
>
> Ah thanks, I thought I must be missing something fairly obvious but couldn't
> see what it was
FWIW I was also about to comment on that. Maybe that warrants even a code
comment above the `prev_reflog_action`?
Ciao,
Dscho
next prev parent reply other threads:[~2020-04-07 14:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-01 20:31 [PATCH] sequencer: honor GIT_REFLOG_ACTION Elijah Newren via GitGitGadget
2020-04-01 20:46 ` Junio C Hamano
2020-04-01 23:29 ` Ian Jackson
2020-04-02 5:15 ` Elijah Newren
2020-04-02 9:39 ` Phillip Wood
2020-04-02 17:40 ` Elijah Newren
2020-04-02 9:25 ` Phillip Wood
2020-04-02 17:01 ` Elijah Newren
2020-04-02 19:05 ` Phillip Wood
2020-04-07 14:50 ` Johannes Schindelin [this message]
2020-04-07 15:18 ` Elijah Newren
2020-04-07 22:37 ` Johannes Schindelin
2020-04-07 23:05 ` Junio C Hamano
2020-04-07 16:59 ` [PATCH v2] " Elijah Newren via GitGitGadget
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=nycvar.QRO.7.76.6.2004071649190.46@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=alban.gruin@gmail.com \
--cc=elbrus@debian.org \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=ijackson@chiark.greenend.org.uk \
--cc=jrnieder@gmail.com \
--cc=newren@gmail.com \
--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.
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).