From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: David Turner <David.Turner@twosigma.com>,
"git\@vger.kernel.org" <git@vger.kernel.org>,
"pclouds\@gmail.com" <pclouds@gmail.com>
Subject: Re: [PATCH v3] gc: ignore old gc.log files
Date: Fri, 10 Feb 2017 13:04:09 -0800 [thread overview]
Message-ID: <xmqqlgtdkbau.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170210205138.5nnexap32pkbjjrk@sigill.intra.peff.net> (Jeff King's message of "Fri, 10 Feb 2017 15:51:38 -0500")
Jeff King <peff@peff.net> writes:
> I dunno. This seems like a lot of manual scrambling to try to overcome
> unlikely errors just to make our stderr heard (and we'd still fail in
> some cases). It seems like:
>
> if (fstat(...)) {
> /* weird, fstat failed; try our best to mention it */
> error_errno("unable to fstat gc.log.lock");
> commit_lock_file(&log_lock));
> } else if (st.st_size) {
> /* we have new errors to report */
> commit_lock_file(&log_lock);
> } else {
> /* no new errors; clean up old ones */
> unlink(git_path("gc.log"));
> rollback_lock_file(&log_lock);
> }
>
> would be sufficient.
Yeah, that should be sufficient.
prev parent reply other threads:[~2017-02-10 21:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 19:20 [PATCH v3] gc: ignore old gc.log files David Turner
2017-02-10 19:47 ` Junio C Hamano
2017-02-10 19:56 ` Junio C Hamano
2017-02-10 20:08 ` Jeff King
2017-02-10 20:44 ` David Turner
2017-02-10 20:51 ` Jeff King
2017-02-10 21:04 ` Junio C Hamano [this message]
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=xmqqlgtdkbau.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=David.Turner@twosigma.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox