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

Re: [PATCH] fix deletion of .git/objects sub-directories in git-prune/repack

From
karsten.blees@dcon.de <karsten.blees@dcon.de>
Date
Mar 6, 2012, 21:47 UTC
Message-ID
<OF619F6614.68A2AA34-ONC12579B9.00763235-C12579B9.0077B76F@dcon.de>
In-Reply-To
<4F565849.80303@kdbg.org>
Johannes Sixt <j6t@kdbg.org> wrote on 06.03.2012 19:32:41:
Show 12 quoted lines
> Am 06.03.2012 10:18, schrieb karsten.blees@dcon.de:
> > On some systems (e.g. Windows XP), directories cannot be deleted while
> > they're open. Both git-prune and git-repack (and thus, git-gc) try to
> > rmdir while holding a DIR* handle on the directory, leaving dangling
> > empty directories in the .git/objects store.
> > 
> > Fix it by swapping the rmdir / closedir calls.
> 
> The reasoning makes a lot of sense. I wonder why object directories are
> pruned nevertheless when I run git gc --prune (I run git master plus a
> few topics from pu).
> 

You're right...in upstream git, closedir() is essentially a NOOP. The OS handle is closed in readdir() on reading the last entry. The dirent.c 'improvements' that move FindFirstFile() to opendir() and FindClose() to closedir() are in the msysgit fork only [1] (and entirely my fault, I guess :-)).

So this patch actually isn't currently required for Windows XP (probably other platforms, I don't know).

[1] https://github.com/msysgit/git/commit/e2b3f70b
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***

*** Please avoid top-posting. ***

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en
Previous: Junio C Hamano
Message 9 of 9 in “fix deletion of .git/objects sub-directories in git-prune/repack”
  1. fix deletion of .git/objects sub-directories in git-prune/repackkarsten.blees@dcon.de, Mar 6, 2012
  2. Johannes SixtMar 6, 2012
  3. Junio C HamanoMar 6, 2012
  4. Johannes SixtMar 6, 2012
  5. karsten.blees@dcon.deMar 6, 2012
  6. Junio C HamanoMar 6, 2012
  7. karsten.blees@dcon.deMar 7, 2012
  8. Junio C HamanoMar 6, 2012
  9. karsten.blees@dcon.deMar 6, 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.