From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Jon Forrest <nobozo@gmail.com>, Derrick Stolee <stolee@gmail.com>
Subject: Re: [PATCH] abbrev: allow extending beyond 20 chars to disambiguate
Date: Mon, 11 Aug 2025 11:53:56 -0700 [thread overview]
Message-ID: <xmqq5xet3d17.fsf@gitster.g> (raw)
In-Reply-To: <xmqqfrdx517b.fsf@gitster.g> (Junio C. Hamano's message of "Mon, 11 Aug 2025 08:26:32 -0700")
Junio C Hamano <gitster@pobox.com> 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.
next prev parent reply other threads:[~2025-08-11 18:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-11 15:26 [PATCH] abbrev: allow extending beyond 20 chars to disambiguate Junio C Hamano
2025-08-11 18:53 ` Junio C Hamano [this message]
2025-08-11 19:06 ` [PATCH v2] " Junio C Hamano
2025-08-11 22:23 ` brian m. carlson
2025-08-12 13:28 ` Derrick Stolee
2025-08-12 14:58 ` René Scharfe
2025-08-12 15:17 ` Junio C Hamano
2025-08-12 15:59 ` René Scharfe
2025-08-14 15:09 ` [PATCH v3] abbrev: allow extending beyond 32 " Junio C Hamano
2025-08-11 21:17 ` [PATCH] abbrev: allow extending beyond 20 " brian m. carlson
2025-08-11 21:25 ` Junio C Hamano
2025-08-11 21:28 ` Junio C Hamano
2025-08-12 15:26 ` Jon Forrest
2025-08-12 16:21 ` René Scharfe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq5xet3d17.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=nobozo@gmail.com \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).