git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git branch -D: give a better error message when lockfile creation fails

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 26, 2009, 20:04 UTC
Message-ID
<vpqy6o15v6m.fsf@bauges.imag.fr>
In-Reply-To
<20090926195812.GH14660@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 13 quoted lines
> Miklos Vajna <vmiklos@frugalware.org> wrote:
>> On Fri, Sep 25, 2009 at 11:31:43PM -0400, Jeff King <peff@peff.net> wrote:
>> > afterwards). So probably you would need to first refactor
>> > unable_to_lock_index_die() to handle just printing the error without
>> > dying.
>> 
>> I removed the NORETURN macro as otherwise gcc would issue a warning, as
>> it does not realise that unable_to_lock_index_die() never returns.
>
> Please don't.  If you refactor the error message formatting into
> a static function called from the two extern ones, you can still
> centralize the formatting but also keep NORETURN on the method that
> doesn't return.  The annotation is useful and should not be removed.
I guess the lint-trap would be to add a
  die("unable_to_lock_index() should have died already");
at the end of unable_to_lock_index_die().
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Shawn O. PearceNext: Miklos Vajna
Message 5 of 9 in “git branch -D: give a better error message when lockfile creation fails”
  1. git branch -D: give a better error message when lockfile creation failsMiklos Vajna, Sep 26, 2009
  2. Jeff KingSep 26, 2009
  3. git branch -D: give a better error message when lockfile creation failsMiklos Vajna, Sep 26, 2009
  4. Shawn O. PearceSep 26, 2009
  5. Matthieu MoySep 26, 2009
  6. git branch -D: give a better error message when lockfile creation failsMiklos Vajna, Sep 26, 2009
  7. Jeff KingSep 27, 2009
  8. Miklos VajnaSep 27, 2009
  9. Matthieu MoySep 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.