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

Re: [PATCH 1/2] pack-refs: remove all empty directories under $GIT_DIR/refs

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 11, 2012, 17:59 UTC
Message-ID
<7vd39lmetr.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8Bh=FZ6kNN5hERK5_H7XnZ83BZ_EfsZ5XmJbrnn+CfgcQ@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 9 quoted lines
> 2012/2/11 Junio C Hamano <gitster@pobox.com>:
>> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> ...
>> Would it make more sense to note the
>> directory for which rmdir() fails in try_remove_empty_parents(), and
>> revisit only these directories, at least?
>
> That would leave empty directories not sharing the ref's path until
> the failed rmdir() unexamined, I think.
True. Thanks.
Show 6 quoted lines
>>> +     subpath = xmalloc(pathlen + 257);
>>
>> What is this 257 about?
>
> This function is a ripoff from get_ref_dir(). I think 257 is 255 below
> plus '/' and NIL.

I do not think there is any justification to copy-and-paste from code that predates the strbuf infrastructure these days.

Previous: Nguyen Thai Ngoc DuyNext: Nguyễn Thái Ngọc Duy
Message 8 of 10 in “Remove empty ref directories while reading loose refs”
  1. Remove empty ref directories while reading loose refsNguyễn Thái Ngọc Duy, Feb 10, 2012
  2. Junio C HamanoFeb 10, 2012
  3. Jeff KingFeb 10, 2012
  4. 1/2 pack-refs: remove all empty directories under $GIT_DIR/refsNguyễn Thái Ngọc Duy, Feb 11, 2012
  5. 2/2 Revert be7c6d4 (pack-refs: remove newly empty directories)Nguyễn Thái Ngọc Duy, Feb 11, 2012
  6. Junio C HamanoFeb 11, 2012
  7. Nguyen Thai Ngoc DuyFeb 11, 2012
  8. Junio C HamanoFeb 11, 2012
  9. pack-refs: remove all empty dirs under .git/{refs,logs/refs}Nguyễn Thái Ngọc Duy, Feb 11, 2012
  10. Thomas AdamFeb 11, 2012

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.