git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Cleaning up files reported by size-garbage
@ 2020-08-27 15:55 Konstantin Ryabitsev
  2020-08-27 17:19 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Ryabitsev @ 2020-08-27 15:55 UTC (permalink / raw)
  To: git

Hello:

Running git count-objects -v reports garbage files:

$ git count-objects -v
warning: garbage found: ./objects/pack/tmp_pack_XSv8MO
warning: garbage found: ./objects/pack/tmp_pack_2uOuMg
warning: garbage found: ./objects/pack/tmp_pack_KzP1ja
count: 19
size: 84
in-pack: 172456
packs: 6
size-pack: 63907
prune-packable: 0
garbage: 3
size-garbage: 1911

Is there a way to tell git to clean those up? I'm not finding anything 
and would rather avoid having to parse stderr in these cases.

Best,
-K

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Cleaning up files reported by size-garbage
  2020-08-27 15:55 Cleaning up files reported by size-garbage Konstantin Ryabitsev
@ 2020-08-27 17:19 ` Jeff King
  2020-08-27 17:36   ` Konstantin Ryabitsev
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2020-08-27 17:19 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: git

On Thu, Aug 27, 2020 at 11:55:29AM -0400, Konstantin Ryabitsev wrote:

> Running git count-objects -v reports garbage files:
> 
> $ git count-objects -v
> warning: garbage found: ./objects/pack/tmp_pack_XSv8MO
> warning: garbage found: ./objects/pack/tmp_pack_2uOuMg
> warning: garbage found: ./objects/pack/tmp_pack_KzP1ja
> count: 19
> size: 84
> in-pack: 172456
> packs: 6
> size-pack: 63907
> prune-packable: 0
> garbage: 3
> size-garbage: 1911
> 
> Is there a way to tell git to clean those up? I'm not finding anything 
> and would rather avoid having to parse stderr in these cases.

I think that git-gc will clean them up (via git-prune). It will also
check that their mtimes are older than the expiration time, which avoids
accidentally cleaning up the pack for an incoming fetch or push.

The default gc expiration time is 2 weeks, though, so you might want
something like:

  git gc --prune=5.minutes.ago

if you're trying to get rid of them immediately. Likewise use git-prune
directly if you don't want to incur the cost of a full gc/repack.

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Cleaning up files reported by size-garbage
  2020-08-27 17:19 ` Jeff King
@ 2020-08-27 17:36   ` Konstantin Ryabitsev
  0 siblings, 0 replies; 3+ messages in thread
From: Konstantin Ryabitsev @ 2020-08-27 17:36 UTC (permalink / raw)
  To: Jeff King; +Cc: git

On Thu, Aug 27, 2020 at 01:19:54PM -0400, Jeff King wrote:
> I think that git-gc will clean them up (via git-prune). It will also
> check that their mtimes are older than the expiration time, which avoids
> accidentally cleaning up the pack for an incoming fetch or push.
> 
> The default gc expiration time is 2 weeks, though, so you might want
> something like:
> 
>   git gc --prune=5.minutes.ago
> 
> if you're trying to get rid of them immediately. Likewise use git-prune
> directly if you don't want to incur the cost of a full gc/repack.

Oh, you're totally right. For some reason I was convinced that git-prune 
didn't touch them, but I stand corrected.

Thanks for the pointer!

-K

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-27 17:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 15:55 Cleaning up files reported by size-garbage Konstantin Ryabitsev
2020-08-27 17:19 ` Jeff King
2020-08-27 17:36   ` Konstantin Ryabitsev

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).