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

Re: [PATCH] prune: recursively prune objects directory

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 22, 2022, 23:16 UTC
Message-ID
<xmqqbkoyr35p.fsf@gitster.g>
In-Reply-To
<20221122095943.M478967@dcvr>
Eric Wong <e@80x24.org> writes:
Show 12 quoted lines
> Junio C Hamano <gitster@pobox.com> wrote:
>> Eric Wong <e@80x24.org> writes:
>> 
>> > I am unsure about duplicating ishex() from name-rev.c, however...
>> 
>> Yeah, I wonder why name-rev.c does not use isxdigit() in the first
>> place.
>
> isxdigit includes uppercase [A-F].  I think being strict is
> better, here.  I don't want to open up a can of worms if we
> become tolerant of 3rd-party git implementations developed on
> case-insensitive FSes.

OK, we do not recurse into .git/objects/AA/ for the same reason why we do not recurse into .git/objects/info/. We do expect [0-9a-f]{2} and pack to be directories, so we go silent if they are missing, but we do complain if somebody creates a regular file .git/objects/aa for fun.

I agree that isxdigit() is not a good match. I also agree with what you said about it belong to git-compat-util.h but let's leave it for a future clean-up patch to remove both copies of ishex(), introduce islxdigit() in git-compat-util.h and use it as its replacement.

Previous: Eric WongNext: Ævar Arnfjörð Bjarmason
Message 9 of 10 in “prune: quiet ENOENT on missing directories”
  1. prune: quiet ENOENT on missing directoriesEric Wong, Nov 19, 2022
  2. Junio C HamanoNov 21, 2022
  3. Eric WongNov 21, 2022
  4. Junio C HamanoNov 21, 2022
  5. Junio C HamanoNov 21, 2022
  6. prune: recursively prune objects directoryEric Wong, Nov 22, 2022
  7. Junio C HamanoNov 22, 2022
  8. Eric WongNov 22, 2022
  9. Junio C HamanoNov 22, 2022
  10. Ævar Arnfjörð BjarmasonNov 21, 2022

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.