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

git rev-parse -q --verify $SHA doesn't always quiet errors

From
Kevin Ballard <kevin@sb.org>
Date
Nov 4, 2010, 22:54 UTC
Message-ID
<4A1CAE91-E31C-46B5-A614-9634D8FC1FB1@sb.org>

The -q flag to git rev-parse --verify is supposed to quiet all errors. However it doesn't appear to quiet the "short SHA1 is ambiguous" error.

% cd Dev/git % git rev-parse -q --verify e51d error: short SHA1 e51d is ambiguous.

I took a quick look, and the error is being emitted deep within sha1_name.c, far outside of any access to the -q flag. I'm not sure how to go about fixing this. Does anyone have any ideas?

Alternatively, is there a better way to tell if a given string can resolve into a full sha1 besides

  git rev-parse -q --verify "$word" 2>/dev/null
-Kevin Ballard
Next: Jonathan Nieder
Message 1 of 2 in “git rev-parse -q --verify $SHA doesn't always quiet errors”
  1. Kevin BallardNov 4, 2010
  2. Jonathan NiederNov 5, 2010

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.