Re: [PATCH 2/3] sha1_name: get_sha1_with_context learns to follow symlinks
- From
Jeff King <peff@peff.net>
- Date
- May 8, 2015, 20:39 UTC
- Message-ID
- <20150508203952.GA13457@peff.net>
- In-Reply-To
- <xmqq6182ke9i.fsf@gitster.dls.corp.google.com>
On Fri, May 08, 2015 at 01:25:45PM -0700, Junio C Hamano wrote:
Show 5 quoted lines
> Perhaps something like the attached patch is a good idea (I used > "BUG:" for now), I wonder? > > Documentation/CodingGuidelines | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-)
Yeah, this looks good (and we definitely prefer BUG:, though I am responsible for over 1/3 of the existing incidences).
I have been tempted to provide a macro or function for it, and have it actually call abort() to trigger a coredump. I.e., basically assert(), except unconditional but you get to write a more useful message.
So all of the sites would just become:
BUG("frotz() called with NULL pointer to xyzzy parameter");or similar.
-Peff