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

lstat() call in rev-parse.c

From
Paul Mackerras <paulus@samba.org>
Date
Apr 23, 2006, 12:03 UTC
Message-ID
<17483.27938.890830.375324@cargo.ozlabs.ibm.com>

Why does git-rev-parse do an lstat on some of its arguments, at line 345 of rev-parse.c, and die if the lstat fails? It doesn't seem to do anything with the result.

The effect is that if you do "gitk a b", it works as long as a and b exist (as files or directories), but fails if they don't, and some users have found this confusing. Yes they should put in a --, but it's not obvious to users why this should make it work in the case when a or b doesn't exist.

(And yes I just took out the git-rev-parse call from gitk, but I'm going to need to do git-rev-parse --no-refs --no-flags for some changes I'm doing at the moment.)

Paul.
Next: Linus Torvalds
Message 1 of 8 in “lstat() call in rev-parse.c”
  1. Paul MackerrasApr 23, 2006
  2. Linus TorvaldsApr 23, 2006
  3. Paul MackerrasApr 24, 2006
  4. Matthias LederhoferApr 26, 2006
  5. Linus TorvaldsApr 26, 2006
  6. Fix filename verification when in a subdirectoryLinus Torvalds, Apr 26, 2006
  7. Timo HirvonenApr 26, 2006
  8. Linus TorvaldsApr 26, 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.