Thread (1 message) 1 message, 1 author, 2025-08-11

Re: [PATCH] abbrev: allow extending beyond 20 chars to disambiguate

From: Junio C Hamano <hidden>
Date: 2025-08-11 18:53:59

Junio C Hamano [off-list ref] writes:
keeps extending the abbreviation.  The loop stops at GIT_MAX_RAWSZ,
which is counted as the number of bytes, since 5b20ace6 (sha1_name:
unroll len loop in find_unique_abbrev_r(), 2017-10-08); before that
change, it extended up to GIT_MAX_HEXSZ, which is the correct limit
because the loop is adding one output letter per iteration.
This is half a truth.  It is correct that the loop used to terminate
at GIT_SHA1_HEXSZ, and replacing it with GIT_MAX_HEXSZ is wrong, as
MAX_HEXSZ can be much larger than the max hexsz for the hash function
in use in the repository.

I'll be sending a reworked version that takes the current hash
function into account.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help