• J
    fix overslow :/no-such-string-ever-existed diagnostics · 2e83b66c
    Junio C Hamano 提交于
    "git cmd :/no-such-string-ever-existed" runs an extra round of get_sha1()
    since 009fee47 (Detailed diagnosis when parsing an object name fails.,
    2009-12-07).  Once without error diagnosis to see there is no commit with
    such a string in the log message (hence "it cannot be a ref"), and after
    seeing that :/no-such-string-ever-existed is not a filename (hence "it
    cannot be a path, either"), another time to give "better diagnosis".
    
    The thing is, the second time it runs, we already know that traversing the
    history all the way down to the root will _not_ find any matching commit.
    
    Rename misguided "gently" parameter, which is turned off _only_ when the
    "detailed diagnosis" codepath knows that it cannot be a ref and making the
    call only for the caller to die with a message.  Flip its meaning (and
    adjust the callers) and call it "only_to_die", which is not a great name,
    but it describes far more clearly what the codepaths that switches their
    behaviour based on this variable do.
    
    On my box, the command spends ~1.8 seconds without the patch to make the
    report; with the patch it spends ~1.12 seconds.
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    2e83b66c
setup.c 20.3 KB