man git-gc doesn\'t have an obvious answer in it, and I haven\'t had any luck with Google either (although I might have just been using the wrong search terms).
I un
The issue with git gc --auto
is that it can be blocking.
But with the new (Git 2.0 Q2 2014) setting gc.autodetach
, you now can do it without any interruption:
See commit 4c4ac4d and commit 9f673f9 (Nguyễn Thái Ngọc Duy, aka pclouds):
gc --auto
takes time and can block the user temporarily (but not any less annoyingly).
Make it run in background on systems that support it.
The only thing lost with running in background is printouts. Butgc output
is not really interesting.
You can keep it in foreground by changinggc.autodetach
.
Note: only git 2.7 (Q4 2015) will make sure to not loose the error message.
See commit 329e6e8 (19 Sep 2015) by Nguyễn Thái Ngọc Duy (pclouds).
(Merged by Junio C Hamano -- gitster -- in commit 076c827, 15 Oct 2015)
gc
: save log from daemonizedgc --auto
and print it next timeWhile commit 9f673f9 (
gc
: config option for running--auto
in background - 2014-02-08) helps reduce some complaints about 'gc --auto
' hogging the terminal, it creates another set of problems.The latest in this set is, as the result of daemonizing,
stderr
is closed and all warnings are lost. This warning at the end ofcmd_gc()
is particularly important because it tells the user how to avoid "gc --auto
" running repeatedly.
Because stderr is closed, the user does not know, naturally they complain about 'gc --auto
' wasting CPU.Daemonized
gc
now savesstderr
to$GIT_DIR/gc.log
.
Followinggc --auto
will not run andgc.log
printed out until the user removesgc.log
.