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

Re: print errors from git-update-ref

From
Shawn Pearce <spearce@spearce.org>
Date
Jul 28, 2006, 06:27 UTC
Message-ID
<20060728062720.GC30783@spearce.org>
In-Reply-To
<Pine.LNX.4.63.0607271302150.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 11 quoted lines
> Hi,
> 
> On Wed, 26 Jul 2006, Shawn Pearce wrote:
> 
> > This change adds a test for trying to create a ref within a directory
> > that is actually currently a file, and adds error printing within
> > the ref locking routine should the resolve operation fail.
> 
> Why not just print an error message when the resolve operation fails, 
> instead of special casing this obscure corner case? It is way shorter, 
> too. The test should stay, though.

Did you read the patch? If resolve_ref returns NULL then this change prints an error (from errno) no matter what. If errno is ENOTDIR then it tries to figure out what part of the ref path wasn't a directory (but was attempted to be used as such) and prints an ENOTDIR error about that path instead of the one actually given to the ref lock function

So I think I'm doing what you are suggesting...
-- 
Shawn.
Previous: Johannes SchindelinNext: Junio C Hamano
Message 5 of 7 in “print errors from git-update-ref”
  1. Alex RiesenJul 18, 2006
  2. Junio C HamanoJul 24, 2006
  3. Shawn PearceJul 27, 2006
  4. Johannes SchindelinJul 27, 2006
  5. Shawn PearceJul 28, 2006
  6. Junio C HamanoJul 28, 2006
  7. Shawn PearceJul 29, 2006

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.