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

Re: [PATCH] clone: pass --progress decision to recursive submodules

From
Jeff King <peff@peff.net>
Date
Sep 23, 2016, 03:31 UTC
Message-ID
<20160923033143.azkwbbh54oistg6u@sigill.intra.peff.net>
In-Reply-To
<CAGZ79kbTi+5oo325v+v8GB7isKRfqys6WRGUARHiMvieDz+png@mail.gmail.com>
On Thu, Sep 22, 2016 at 08:36:01AM -0700, Stefan Beller wrote:
> > Signed-off-by: Jeff King <peff@peff.net>
> 
> Acked and thanked by Stefan ;)
Thanks.
Show 12 quoted lines
> > +       /*
> > +        * We want to show progress for recursive submodule clones iff
> > +        * we did so for the main clone. But only the transport knows
> > +        * the final decision for this flag, so we need to rescue the value
> > +        * before we free the transport.
> > +        */
> > +       submodule_progress = transport->progress;
> > +
> 
> Good point! I was aware of this bug (but I did not consider it to be
> impactful or as you put it "much worse"), but I anticipated we would
> need some refactoring

To be fair, "much worse" is relative; it's _just_ a disabled progress bar. :)

I do think this counts as a real regression, though. The "do not pass down explicit --progress" bug was something probably nobody ever cared about. But losing progress with the default settings is a thing people might actually notice.

> of the transport code, e.g. have the decision via isatty(2) as a
> separate outside function that we consult before we even setup the
> transport and then pass it down to the submodules as well. This seems
> to solve this bug elegantly.

Yeah, I considered passing a "no really, stderr is a tty" environment variable down (which would have avoided all of the boilerplate propagation of --progress through the various helpers). But when I realized that we do not handle explicit "--progress" either, the correct solution became more obvious.

And hopefully all that propagation boilerplate will eventually go away (or at least be simplified) as the submodule code consolidates in C.

Show 8 quoted lines
> >  static int clone_submodule(const char *path, const char *gitdir, const char *url,
> > -                          const char *depth, struct string_list *reference, int quiet)
> > +                          const char *depth, struct string_list *reference,
> > +                          int quiet, int progress)
> 
> I am not sure if having both quiet and progress is maintainable well,
> but it get's the job done here, specifically if we consider this patch a bug
> fix that we'd want to merge down to maint.

Yeah, I had a similar thought that we might need to combine these, or possibly that we could even drop "quite". But I tried to err on the side of making the minimal change, as this isn't really a code path I'm very familiar with.

-Peff
Previous: Stefan Beller
Message 3 of 3 in “clone: pass --progress decision to recursive submodules”
  1. clone: pass --progress decision to recursive submodulesJeff King, Sep 22, 2016
  2. Stefan BellerSep 22, 2016
  3. Jeff KingSep 23, 2016

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.