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

Re: [RFC/PATCH 2/2] repack: Remove stale .keep files before repacking

From
Jeff King <peff@peff.net>
Date
Apr 1, 2011, 01:41 UTC
Message-ID
<20110401014150.GC21036@sigill.intra.peff.net>
In-Reply-To
<201104010334.28048.johan@herland.net>
On Fri, Apr 01, 2011 at 03:34:27AM +0200, Johan Herland wrote:
Show 17 quoted lines
> On Thursday 31 March 2011, Jeff King wrote:
> > On Thu, Mar 31, 2011 at 12:46:25PM +0200, Johan Herland wrote:
> > > 3. Do I need to scan for and remove stale .keep files in a cron job
> > > 
> > >    in order to keep repos healthy and clonable?
> > 
> > If we fix (1), then hopefully it is not as much of an issue. But
> > probably "git gc" should clean up stale ones after a while.
> 
> This patch tries to automatically remove stale .keep files. However,
> it's still work-in-progress, as I don't know how to portably (a) ask
> for the current hostname (so that I can compare it to the one in the
> .keep file), or (b) test for whether a given PID is running on the
> system (to determine whether the receive-pack process that wrote the
> .keep file is still alive).
> 
> Feedback appreciated.

Since your 1/2 turns them from an actual problem into just harmless cruft, there's no real rush to get rid of them. Could we just do something like "there is no matching pack file, and the mtime is 2 weeks old"?

If there is a matching pack file, I don't think we want to get rid of them. People can have .keep files if they want to indicate the pack should be kept. I do admit it would be weird to write the "receive-pack" message into them, though.

-Peff
Previous: Johan HerlandNext: Johan Herland
Message 13 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.