On Mon, Sep 26, 2016 at 10:30:48AM -0700, Junio C Hamano wrote:

> Jeff King <p...@peff.net> writes:
> 
> > We also restrict the list to those that match any
> > disambiguation hint. E.g.:
> >
> >   $ git rev-parse b2e1:foo
> >   error: short SHA1 b2e1 is ambiguous
> >   hint: The candidates are:
> >   hint:   b2e1196 tag v2.8.0-rc1
> >   hint:   b2e11d1 tree
> >   hint:   b2e1632 commit 2007-11-14 - Merge branch 'bs/maint-commit-options'
> >   fatal: Invalid object name 'b2e1'.
> >
> > does not bother reporting the blobs, because they cannot
> > work as a treeish.
> 
> That's a nice touch, and it even comes free--how wonderful.
> 
> It somehow felt strange to have an expensive (compared to no-op,
> anyway) loop whose only externally visible effect is to call
> advise(), but there does not appear to be a way to even disable this
> advise() output, so it probably is OK, I guess.

Right, advise() always has an effect. But that reminds me.  I wasn't
sure if we should attach an advice.* config to this. If we do, then the
right place to put the conditional is right after the error() call in
get_short_sha1().

Since it's attached to an error path, I'm guessing nobody will be too
upset about it, so my inclination was to wait and let somebody add the
conditional advice code if they're bothered.

-Peff

Reply via email to