git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 11, 2025, 18:53 UTC
Message-ID
<xmqq5xet3d17.fsf@gitster.g>
In-Reply-To
<xmqqfrdx517b.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
> 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.

Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 14 in “abbrev: allow extending beyond 20 chars to disambiguate”
  1. abbrev: allow extending beyond 20 chars to disambiguateJunio C Hamano, Aug 11, 2025
  2. Junio C HamanoAug 11, 2025
  3. abbrev: allow extending beyond 20 chars to disambiguateJunio C Hamano, Aug 11, 2025
  4. brian m. carlsonAug 11, 2025
  5. Derrick StoleeAug 12, 2025
  6. René ScharfeAug 12, 2025
  7. Junio C HamanoAug 12, 2025
  8. René ScharfeAug 12, 2025
  9. abbrev: allow extending beyond 32 chars to disambiguateJunio C Hamano, Aug 14, 2025
  10. brian m. carlsonAug 11, 2025
  11. Junio C HamanoAug 11, 2025
  12. Junio C HamanoAug 11, 2025
  13. Jon ForrestAug 12, 2025
  14. René ScharfeAug 12, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.