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

Re: option -q not passed from "git commit" to "git gc --auto"

From
Taylor Blau <me@ttaylorr.com>
Date
May 6, 2020, 17:33 UTC
Message-ID
<20200506173356.GC6078@syl.local>
In-Reply-To
<20200506172823.GB6078@syl.local>
On Wed, May 06, 2020 at 11:28:23AM -0600, Taylor Blau wrote:
Show 32 quoted lines
> On Wed, May 06, 2020 at 11:43:27AM +0200, Pierrick Gaudry wrote:
> > Hello,
> >
> > It seems that when "git commit" is run with the "-q" option, there are
> > still, from time to time, messages that get printed. With the French
> > locale the message is:
> >   Compression automatique du dépôt en tâche de fond pour optimiser les performances.
> >   Voir "git help gc" pour toute information sur le nettoyage manuel.
> >
> > From what I could guess, this is due to the fact that "git commit" calls
> > "git gc --auto", but does not propagate the "-q" option if present.
> >
> > A similar problem was present some time ago with "git fetch" and was
> > solved in the 2-line patch 6fceed3b . I guess that the same should be
> > done for "git commit".
>
> Yes, I think so. A quick search through the list archive turns up [1],
> which identifies and provides a patch for this issue. If I were
> reviewing that patch today, I'd suggest the following:
>
>   * break the change from a 'char **' to a 'struct argv_array' into a
>     separate, preparatory patch.
>
>   * adjust the commit message of the second commit (which will only pass
>     '-q' to the 'git-gc' sub-process) to indicate that there may be
>     other locations
>
>   * fix those other locations that spawn 'git gc', if they exist, in a
>     similar fashion
>
>   * in each of the previous two steps, add tests in the appropriate
>     files in 't' to demonstrate that '-q' propagation works as expected.

Junio identified a much better way to do this in the email below this one. Since it appears that there are multiple places that ignore '--quiet' when running 'git gc' as a sub-process, a helper function is certainly you want to be using.

Show 10 quoted lines
> I'm happy to do any and all of this, if you want, but you are also
> welcome to submit the patches yourself.
>
> > Regards,
> > Pierrick
>
> Thanks,
> Taylor
>
> [1]: https://lore.kernel.org/git/20200506140138.650455-1-abhishekkumar8222@gmail.com/

Thanks, Taylor

Previous: Taylor BlauNext: Taylor Blau
Message 3 of 13 in “option -q not passed from "git commit" to "git gc --auto"”
  1. Pierrick GaudryMay 6, 2020
  2. Taylor BlauMay 6, 2020
  3. Taylor BlauMay 6, 2020
  4. Taylor BlauMay 6, 2020
  5. Junio C HamanoMay 6, 2020
  6. Re* option -q not passed from "git commit" to "git gc --auto"Junio C Hamano, May 6, 2020
  7. 2/2 auto-gc: pass --quiet down from am, commit, merge and rebaseJunio C Hamano, May 6, 2020
  8. Junio C HamanoMay 6, 2020
  9. 0/2 Pass down "--quiet" to "gc --auto"Junio C Hamano, May 6, 2020
  10. 2/2 auto-gc: pass --quiet down from am, commit, merge and rebaseJunio C Hamano, May 6, 2020
  11. Taylor BlauMay 7, 2020
  12. Junio C HamanoMay 7, 2020
  13. 1/2 auto-gc: extract a reusable helper from "git fetch"Junio C Hamano, May 6, 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.