git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git gc does not clean tmp_pack* files
@ 2024-12-19  2:19 Boomman
  2024-12-19  5:42 ` Jeff King
  0 siblings, 1 reply; 8+ messages in thread
From: Boomman @ 2024-12-19  2:19 UTC (permalink / raw)
  To: git

Hello,

I'm currently hitting an issue trying to garbage collect a git repo in
case of low disk space.
After running "git gc" a bunch of times I tried to clean up more and
more space on the disk not realizing that when "git gc" fails it just
leaves the tmp_pack file there.

D:\Platform>git gc
...blah...
fatal: sha1 file '.git/objects/pack/tmp_pack_FG1inp' write error. Out
of diskspace
fatal: failed to run repack

D:\Platform>git gc
...blah...
fatal: sha1 file '.git/objects/pack/tmp_pack_IFvamY' write error. Out
of diskspace
fatal: failed to run repack

D:\Platform>git gc
...blah...
fatal: sha1 file '.git/objects/pack/tmp_pack_khHCC9' write error. Out
of diskspace
fatal: failed to run repack

D:\Platform>dir .git\objects\pack\tmp*
 Directory of D:\Platform\.git\objects\pack

12/18/2024  05:33 PM     7,367,032,832 tmp_pack_FG1inp
12/18/2024  05:35 PM     3,787,194,368 tmp_pack_IFvamY
12/18/2024  05:39 PM     7,713,062,912 tmp_pack_khHCC9
09/11/2024  11:33 AM     3,068,002,304 tmp_pack_XTVFUi
               4 File(s) 21,935,292,416 bytes
               0 Dir(s)         339,968 bytes free

I believe that before trying to write *anything* to disk "git gc"
should try to take exclusive handles on these and wipe them, ideally
by default. The total size of these tmp* files is multiple times
larger than the repo I'm trying to compact, so if the command just did
this pre-cleaning I'd not have hit this problem once I cleaned enough
disk space.

Please let me know your thoughts on this.

-Vitaly

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

end of thread, other threads:[~2024-12-28 20:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19  2:19 git gc does not clean tmp_pack* files Boomman
2024-12-19  5:42 ` Jeff King
2024-12-19  8:26   ` Boomman
2024-12-19 11:17     ` Junio C Hamano
2024-12-20  9:05       ` Jeff King
2024-12-21  1:17         ` Boomman
2024-12-28 19:44           ` Jeff King
2024-12-28 20:13             ` Boomman

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 NNTP newsgroup(s).