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

Re: [PATCH] gc: introduce an --auto-exit-code option for undoing 3029970275

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 10, 2018, 21:14 UTC
Message-ID
<20181010211428.GA231512@aiede.svl.corp.google.com>
In-Reply-To
<87sh1declw.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason wrote:
Show 18 quoted lines
>     Right. I know. What I mean is now I can (and do) use it to run 'git gc
>     --auto' across our server fleet and see whether I have any of #3, or
>     whether it's all #1 or #2. If there's nothing to do in #1 that's fine,
>     and it just so happens that I'll run gc due to #2 that's also fine, but
>     I'd like to see if gc really is stuck.
>
>     This of course relies on them having other users / scripts doing normal
>     git commands which would trigger previous 'git gc --auto' runs.
>
> I.e. with your change that command:
>
>     git gc --auto
>
> Would change to something like:
>
>     git gc --auto && ! test -e .git/gc.log
>
> Which, as noted is a bit of a nasty breaker of the encapsulation

That helps. What if we package up the "test -e .git/gc.log" bit *without* having the side effect of running git gc --auto, so that you can run

	if ! git gc --detached-exit-code
	then
		... handle the error ...
	fi
	git gc --auto; # perhaps also with --detach
?

I'm not great at naming options, so the --detached-exit-code name is bikesheddable. What I really mean to ask about is: what if the status reporting goes in a separate command from running gc --auto?

Perhaps this reporting could also print the message from a previous run, so you could write:

	git gc --detached-status || exit
	git gc --auto; # perhaps also passing --detach
(Names still open for bikeshedding.)

Thanks and hope that helps, Jonathan

Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 16 of 26 in “git svn clone/fetch hits issues with gc --auto”
  1. Martin LanghoffOct 9, 2018
  2. Eric WongOct 9, 2018
  3. Junio C HamanoOct 10, 2018
  4. Martin LanghoffOct 10, 2018
  5. Ævar Arnfjörð BjarmasonOct 10, 2018
  6. Martin LanghoffOct 10, 2018
  7. Ævar Arnfjörð BjarmasonOct 10, 2018
  8. Jonathan NiederOct 10, 2018
  9. Jeff KingOct 10, 2018
  10. gc: introduce an --auto-exit-code option for undoing 3029970275Ævar Arnfjörð Bjarmason, Oct 10, 2018
  11. Jeff KingOct 10, 2018
  12. Ævar Arnfjörð BjarmasonOct 10, 2018
  13. Jeff KingOct 11, 2018
  14. Jonathan NiederOct 10, 2018
  15. Ævar Arnfjörð BjarmasonOct 10, 2018
  16. Jonathan NiederOct 10, 2018
  17. Junio C HamanoOct 10, 2018
  18. Jonathan NiederOct 10, 2018
  19. Ævar Arnfjörð BjarmasonOct 10, 2018
  20. Jonathan NiederOct 10, 2018
  21. Ævar Arnfjörð BjarmasonOct 10, 2018
  22. Ævar Arnfjörð BjarmasonOct 10, 2018
  23. Junio C HamanoOct 10, 2018
  24. Ævar Arnfjörð BjarmasonOct 10, 2018
  25. Martin LanghoffOct 10, 2018
  26. Ævar Arnfjörð BjarmasonOct 10, 2018

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.