git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Andrey Okoshkin <a.okoshkin@samsung.com>
Cc: gitster@pobox.com, git@vger.kernel.org,
	Ivan Arishchenko <i.arishchenk@samsung.com>,
	Mikhail Labiuk <m.labiuk@samsung.com>
Subject: Re: [PATCH v4] commit: check result of resolve_ref_unsafe
Date: Sat, 21 Oct 2017 02:19:21 -0400	[thread overview]
Message-ID: <20171021061921.xtocfdfik6ehhwzw@sigill.intra.peff.net> (raw)
In-Reply-To: <a9cce39c-e432-d5a7-d9ad-6b67d9e04d23@samsung.com>

On Fri, Oct 20, 2017 at 04:09:30PM +0300, Andrey Okoshkin wrote:

> Add check of the resolved HEAD reference while printing of a commit summary.
> resolve_ref_unsafe() may return NULL pointer if underlying calls of lstat() or
> open() fail in files_read_raw_ref().
> Such situation can be caused by race: file becomes inaccessible to this moment.
> 
> Signed-off-by: Andrey Okoshkin <a.okoshkin@samsung.com>
> ---
> Hello,
> I think this way is better for user experience:
> * git doesn't crash;
> * warning is shown;
> * commit has been successfully created then it's safe to show a summary message
> with already known information and without resolved HEAD.

I'm on the fence between this and the die_errno() version. Given that
this would basically never happen in practice, I don't think it matters
too much. And that makes me want to just err on the side of simplicity.
But it's not like this is all that complex, either.

-Peff

  reply	other threads:[~2017-10-21  6:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171018170047epcas2p4310be357e11e194d6d08ac3bdc478ba3@epcas2p4.samsung.com>
2017-10-18 17:00 ` [PATCH] commit: check result of resolve_ref_unsafe Andrey Okoshkin
2017-10-18 18:34   ` Jeff King
2017-10-19  0:41     ` Junio C Hamano
2017-10-19  2:49       ` Jeff King
2017-10-19  9:33         ` Andrey Okoshkin
2017-10-19  9:36   ` [PATCH v2] " Andrey Okoshkin
2017-10-19 17:44     ` Jeff King
2017-10-19 17:46       ` [PATCH 1/4] test-ref-store: avoid passing NULL to printf Jeff King
2017-10-19 17:47       ` [PATCH 2/4] remote: handle broken symrefs Jeff King
2017-10-19 17:53         ` Jeff King
2017-10-19 17:49       ` [PATCH 3/4] log: handle broken HEAD in decoration check Jeff King
2017-10-19 17:49       ` [PATCH 4/4] worktree: handle broken symrefs in find_shared_symref() Jeff King
2017-10-21 10:49         ` Eric Sunshine
2017-10-21 19:26           ` Jeff King
2017-10-22  0:46             ` Junio C Hamano
2017-10-20 10:40       ` [PATCH v2] commit: check result of resolve_ref_unsafe Andrey Okoshkin
2017-10-20 11:03       ` [PATCH v3] " Andrey Okoshkin
2017-10-20 13:09         ` [PATCH v4] " Andrey Okoshkin
2017-10-21  6:19           ` Jeff King [this message]
2017-10-22  0:46             ` Junio C Hamano

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=20171021061921.xtocfdfik6ehhwzw@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=a.okoshkin@samsung.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=i.arishchenk@samsung.com \
    --cc=m.labiuk@samsung.com \
    /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;
as well as URLs for NNTP newsgroup(s).