On 07/20/2015 03:37 PM, Peter Maydell wrote: > On 20 July 2015 at 21:57, Eric Blake <ebl...@redhat.com> wrote: >> On 07/20/2015 11:28 AM, Daniel P. Berrange wrote: >>> The current unit test only verify the encryption API, which >> >> grammatical mismatch; you want either: >> tests only verify >> test only verifies >> >>> resulted in us missing a recently introduced bug in the >>> decryption API from commit d3462e3. It was fortunately >>> later discovered & fixed by commit bd0959 thanks to the >> >> Is a 6-byte SHA going to stay unambiguous long enough? git defaults to >> 7-byte to reduce chances of collisions by 16. > > Fortunately causality allows us to disambiguate by knowing > that Daniel can only be referring to a commit that's > already happened rather than one in the future :-)
True, but that doesn't mean git makes it easy to disambiguate. When, in the future, resolving the short name becomes ambiguous, how do you coax git into showing the full SHA of both (or all) candidates, as well as the date they were created, so you can then compare dates to the commit message you are reading and deduce which one was meant? $ git rev-parse ffff error: short SHA1 ffff is ambiguous. ffff error: short SHA1 ffff is ambiguous. fatal: ambiguous argument 'ffff': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' /me goes and reads the man page Hmm - this is something I've never used before: $ git rev-parse --disambiguate=ffff ffffb8c0bd544ab479a7a32a208d9de13aff62d9 ffffbf79aa11e013e8fd14ffb134faee6489b42c ffffff01466a0180de7632842cf583c8a9cbf959 ffffbb369f3ed9bca5ff2867143f76d0c6e069c0 But that still doesn't tell you that two of those are blobs, and two of them commits, nor what dates the commits have, in a way that can easily determine if one of the commits was an ancestor of the point where a (hypothetical) commit message referred to a (once-non-ambiguous) short reference. And (straying off-topic for this list) why does 'git rev-parse --disambiguate ffff' not behave the same as 'git rev-parse --disambiguate=ffff'? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature