From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
git@vger.kernel.org, "Jeff King" <peff@peff.net>
Subject: Re: [PATCH] gc: introduce an --auto-exit-code option for undoing 3029970275
Date: Wed, 10 Oct 2018 14:51:43 -0700 [thread overview]
Message-ID: <20181010215143.GB231512@aiede.svl.corp.google.com> (raw)
In-Reply-To: <xmqqin29lc0s.fsf@gitster-ct.c.googlers.com>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> 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.)
>
> When the command is given --detached-exit-code/status option, what
> does it do? Does it perform the "did an earlier run left gc.log?"
> and report the result and nothing else? In other words, is it a
> pure replacement for "test -e .git/gc.log"?
My intent was the latter. In other words, in the idiom
do_something_async &
... a lot of time passes ...
wait
it is something like the replacement for "wait".
More precisely,
git gc --detached-status || exit
would mean something like
if test -e .git/gc.log # Error from previous gc --detach?
then
cat >&2 .git/gc.log # Report the error.
exit 1
fi
> Or does it do some of
> the "auto-gc" prep logic like guestimating loose object count and
> have that also in its exit status (e.g. "from the gc.log left
> behind, we know that we failed to reduce loose object count down
> sufficiently after finding there are more than 6700 earlier, but now
> we do not have that many loose object, so there is nothing to
> complain about the presence of gc.log")?
Depending on the use case, a user might want to avoid losing
information about the results of a previous "git gc --detach" run,
even if they no longer apply. For example, a user might want to
collect the error message for monitoring or later log analysis, to
track down intermittent gc errors that go away on their own.
A separate possible use case might be a
git gc --needs-auto-gc
command that detects whether an auto gc is needed. With that, a
caller that only wants to learn about errors if auto gc is needed
could run
if git gc --needs-auto-gc
then
git gc --detached-status || exit
fi
> I am bad at naming myself, but worse at guessing what others meant
> with a new thing that was given a new name whose name is fuzzy,
> so... ;-)
No problem. I'm mostly trying to tease out more details about the use
case.
Thanks,
Jonathan
next prev parent reply other threads:[~2018-10-10 21:51 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CACPiFCJZ83sqE7Gaj2pa12APkBF5tau-C6t4_GrXBWDwcMnJHg@mail.gmail.com>
2018-10-09 22:51 ` git svn clone/fetch hits issues with gc --auto Martin Langhoff
2018-10-09 23:45 ` Eric Wong
2018-10-10 2:49 ` Junio C Hamano
2018-10-10 11:01 ` Martin Langhoff
2018-10-10 11:27 ` Ævar Arnfjörð Bjarmason
2018-10-10 11:41 ` Martin Langhoff
2018-10-10 11:48 ` Ævar Arnfjörð Bjarmason
2018-10-10 16:51 ` Jonathan Nieder
2018-10-10 17:46 ` Jeff King
2018-10-10 19:27 ` [PATCH] gc: introduce an --auto-exit-code option for undoing 3029970275 Ævar Arnfjörð Bjarmason
2018-10-10 20:35 ` Jeff King
2018-10-10 20:59 ` Ævar Arnfjörð Bjarmason
2018-10-11 0:38 ` Jeff King
2018-10-10 20:56 ` Jonathan Nieder
2018-10-10 21:05 ` Ævar Arnfjörð Bjarmason
2018-10-10 21:14 ` Jonathan Nieder
2018-10-10 21:36 ` Junio C Hamano
2018-10-10 21:51 ` Jonathan Nieder [this message]
2018-10-10 22:16 ` Ævar Arnfjörð Bjarmason
2018-10-10 22:25 ` Jonathan Nieder
2018-10-10 18:38 ` git svn clone/fetch hits issues with gc --auto Ævar Arnfjörð Bjarmason
2018-10-10 11:43 ` Ævar Arnfjörð Bjarmason
2018-10-10 12:21 ` Junio C Hamano
2018-10-10 12:37 ` Ævar Arnfjörð Bjarmason
2018-10-10 16:38 ` Martin Langhoff
2018-10-10 8:04 ` Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181010215143.GB231512@aiede.svl.corp.google.com \
--to=jrnieder@gmail.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.