Re: [PATCH] fix overslow :/no-such-string-ever-existed diagnostics
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 10, 2011, 23:11 UTC
- Message-ID
- <7v4o52i21x.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <vpqfwomffuy.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> Is this a complement or an alternative? It seems to me that your other > patch makes this first one useless (in the sense that the second call is > always cheap), and avoids complexifying the code of get_sha1_with_mode_1 > for the first call.
I think that the get_sha1_with_mode_1() that is sprinkled with the "gently" conditional everywhere _is_ the primary source of complexity.
I suspect that if 009fee4 did a proper refactoring, get_sha1_with_mode() wouldn't have that "gently" option at all, and the die_verify_filename() wouldn't call get_sha1_with_mode(). Instead, they would share same set of helper functions and the latter would make a few calls to them, only to deal with :<path> and <tree>:<path> cases.