Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Temporary received packs in objects directory

On Thu, Oct 28, 2010 at 1:59 AM, Zivkov, Sasa <sasa.zivkov@xxxxxxx> wrote:
> In one of our Git repositories, hosted by Gerrit code review system, I found
> a
> lot of files named like “incoming_XXXXXXXXXXXXXX.pack”.  Each of these files
> was
> huge and was created by “git push” where a commit contained a huge binary
> file
> (about 300MB).  The push failed and the user retried several times. However,
> the temporary incoming pack wasn’t cleaned by JGIt.

Ouch.  That is a bug in IndexPack class in JGit.  The temporary file
should have been cleaned up if something went wrong and the pack
wasn't able to be fully imported into the repository.

> While we managed to remove the huge binary from the history (using git
> filter-branch), I couldn’t find a legal way to remove these incoming packs.
> Neither “git gc” nor “git prune” removed them.

C Git doesn't clean files in this directory.  That is why we use it as
a temporary directory, the files here are unlikely to be deleted.

> Would it be safe to simply delete these files in the file system?
> Is there a git way to get rid of them?

Yes, if the file is old enough that you are reasonably certain the
file isn't associated with an active push connection.  E.g. anything
older than an hour when there are no active git receive-pack tasks in
gerrit show-queue output.


Back to the top