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

Re: [PATCH] sequencer: honor GIT_REFLOG_ACTION

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 7, 2020, 22:37 UTC
Message-ID
<nycvar.QRO.7.76.6.2004080037080.46@tvgsbejvaqbjf.bet>
In-Reply-To
<CABPp-BFXT1QkTLUFSAju2TwzVdSRjKSyLQYp2KaoW2+S2U8KJw@mail.gmail.com>
Hi Elijah,
On Tue, 7 Apr 2020, Elijah Newren wrote:
Show 44 quoted lines
> On Tue, Apr 7, 2020 at 7:50 AM Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
> >
> > 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`?
>
> Yeah, if it tripped you both up, I'll add such a comment to the code
> to help explain it.

Thank you! Dscho

Previous: Elijah NewrenNext: Junio C Hamano
Message 12 of 14 in “sequencer: honor GIT_REFLOG_ACTION”
  1. sequencer: honor GIT_REFLOG_ACTIONElijah Newren via GitGitGadget, Apr 1, 2020
  2. Junio C HamanoApr 1, 2020
  3. Ian JacksonApr 1, 2020
  4. Elijah NewrenApr 2, 2020
  5. Phillip WoodApr 2, 2020
  6. Elijah NewrenApr 2, 2020
  7. Phillip WoodApr 2, 2020
  8. Elijah NewrenApr 2, 2020
  9. Phillip WoodApr 2, 2020
  10. Johannes SchindelinApr 7, 2020
  11. Elijah NewrenApr 7, 2020
  12. Johannes SchindelinApr 7, 2020
  13. Junio C HamanoApr 7, 2020
  14. sequencer: honor GIT_REFLOG_ACTIONElijah Newren via GitGitGadget, Apr 7, 2020

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.