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

Re: [PATCH 1/2] index-pack: Create .keep files with same permissions and .pack/.idx

From
Jeff King <peff@peff.net>
Date
Apr 1, 2011, 21:41 UTC
Message-ID
<20110401214115.GA18679@sigill.intra.peff.net>
In-Reply-To
<7v1v1lfy7q.fsf@alter.siamese.dyndns.org>
On Fri, Apr 01, 2011 at 02:39:21PM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> Johan Herland <johan@herland.net> writes:
> 
> > While pushing to a remote repo, Git transiently adds a .keep file for the
> > pack being pushed, to protect it from a concurrent "git gc". However, the
> > permissions on this .keep file are such that if a different user attempts
> > a local cross-filesystem clone ("git clone --no-hardlinks") on the server
> > while the .keep file is present (either because of a concurrent push, or
> > because of a prior failed push that left a stale .keep file), the clone
> > will fail because the second user cannot access the .keep file created by
> > the first user.
> 
> While I am not sure if letting a clone proceed while there is a concurrent
> push is even a good idea to begin with, I agree that a stale .keep file is
> a problem.
> 
> I am kind of surprised that we are not using atexit(3) to clean them just
> like we do for lockfiles; wouldn't that be a better solution?

We definitely should do that, but it would also be nice if a power failure, kill -9, or segfault in receive-pack didn't leave a repo unusable.

-Peff
Previous: Junio C HamanoNext: Shawn Pearce
Message 5 of 14 in “Problems with stale .keep files on git server”
  1. Johan HerlandMar 31, 2011
  2. Jeff KingMar 31, 2011
  3. 1/2 index-pack: Create .keep files with same permissions and .pack/.idxJohan Herland, Apr 1, 2011
  4. Junio C HamanoApr 1, 2011
  5. Jeff KingApr 1, 2011
  6. Shawn PearceApr 1, 2011
  7. Junio C HamanoApr 1, 2011
  8. Johan HerlandApr 1, 2011
  9. Junio C HamanoApr 2, 2011
  10. Johan HerlandApr 3, 2011
  11. Johan HerlandApr 1, 2011
  12. 2/2 repack: Remove stale .keep files before repackingJohan Herland, Apr 1, 2011
  13. Jeff KingApr 1, 2011
  14. Johan HerlandApr 1, 2011

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.