rev-list and "ambiguous" IDs
- From
Bryan Turner <bturner@atlassian.com>
- Date
- Nov 14, 2019, 04:35 UTC
- Message-ID
- <CAGyf7-EXOUWYUZXmww2+NyD1OuWEG18n221MPojVSCCu=19JNA@mail.gmail.com>
When using a command like `git rev-list dc41e --`, it's possible to get output like this: (from newer Git versions) error: short SHA1 dc41e is ambiguous hint: The candidates are: hint: dc41eeb01ba commit 2012-11-23 - Stuff from the commit message hint: dc41e0d508b tree hint: dc41e5bef41 tree hint: dc41e11ee18 blob fatal: bad revision 'dc41e'
Is there any way to ask rev-list to be a little...pickier about what it considers a candidate? Almost without question the two trees and the blob aren't what I'm asking for, which means there's actually only one real candidate.
Also, while considering this, I noticed that `git rev-list dc41e11ee18` (the blob from the output above) doesn't fail. It silently exits, nothing written to stdout or stderr, with 0 status. A little surprising; I would have expected rev-list to complain that dc41e11ee18 isn't a valid commit-ish value.
Bryan