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

Re: [PATCH] lock_ref_sha1_basic does not remove empty directories on BSD

From
Junio C Hamano <junkio@cox.net>
Date
Oct 3, 2006, 04:14 UTC
Message-ID
<7vu02mt4qx.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20061002172353.G44b12bbc@leonov.stosberg.net>
Dennis Stosberg <dennis@stosberg.net> writes:
Show 6 quoted lines
> lock_ref_sha1_basic relies on errno beeing set to EISDIR by the
> call to read() in resolve_ref() to detect directories.  But calling
> read() on a directory under NetBSD returns EPERM, and even succeeds
> for local filesystems on FreeBSD.
>
> Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Thanks.

I've always wondered about the code that follows where you patched. It relies on either open() on a directory to fail, or read() from a file descriptor to return something other than what starts with 40-byte hexadecimal (or "ref: blah") to skip directories.

You might probably meant the patch primarily to fix the leftover empty directories issue in "next", but it is also the right thing to do for "master" (and even for "maint"), I think.

I'll apply it to "master" and then merge it into "next".
Previous: Dennis Stosberg
Message 2 of 2 in “lock_ref_sha1_basic does not remove empty directories on BSD”
  1. lock_ref_sha1_basic does not remove empty directories on BSDDennis Stosberg, Oct 2, 2006
  2. Junio C HamanoOct 3, 2006

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.