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