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

Re: [PATCH] git-log: detect dup and fdopen failure

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jun 28, 2007, 05:02 UTC
Message-ID
<20070628050225.GI32223@spearce.org>
In-Reply-To
<4683211E.2010704@freedesktop.org>
Josh Triplett <josh@freedesktop.org> wrote:
Show 8 quoted lines
> Linus Torvalds wrote:
> > That said, the whole "prepend 'x' to the function name" thing is obviously 
> > how git does things, but maybe it would be more readable in the long term 
> > to make the prefix be 'safe_' instead of 'x', or something like that?
> 
> If you want a more verbose name than xfoo, I personally like the foo_or_die
> convention, which reminds you explicitly that the function might kill the
> program.  safe_ might convey exactly the opposite impression.

I think the _gently suffix is already preferred for the non-die()'ing variant of a function within Git. For example see setup_git_directory_gently() or lookup_commit_reference_gently().

Of course pkt-line.c goes and defines safe_read/safe_write. And lets not forget about safe_create_dir() and safe_create_leading_directories().

I guess we're about half-way in both directions. Next function declared with safe_ prefix or _gently suffix will tip the scale in one direction or the other. ;-)

-- 
Shawn.
Previous: Josh Triplett
Message 15 of 15 in “detect dup failure”
  1. detect dup failureJim Meyering, Jun 27, 2007
  2. Alex RiesenJun 27, 2007
  3. git-log: detect dup and fdopen failureJim Meyering, Jun 27, 2007
  4. Alex RiesenJun 27, 2007
  5. Jim MeyeringJun 27, 2007
  6. Alex RiesenJun 27, 2007
  7. Jim MeyeringJun 27, 2007
  8. Alex RiesenJun 27, 2007
  9. Jim MeyeringJun 27, 2007
  10. Geert BoschJun 27, 2007
  11. Jim MeyeringJun 27, 2007
  12. Jim MeyeringJun 27, 2007
  13. Linus TorvaldsJun 27, 2007
  14. Josh TriplettJun 28, 2007
  15. Shawn O. PearceJun 28, 2007

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.