"Auto packing the repository" on every fetch and rebase?

7,371 views
Skip to first unread message

James Cook

unread,
Dec 18, 2014, 12:47:12 PM12/18/14
to chromium-dev
Recently I've started seeing this message every time I do "git rebase-update" or "git-fetch":

Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.

It's not particularly slow, but I'm wondering why it is happening. It prints twice on "git rebase-update".

I've got about 5 local branches, all tracking origin/master, with branch-heads checked out.

Any ideas?

James

Torne (Richard Coles)

unread,
Dec 18, 2014, 1:06:17 PM12/18/14
to James Cook, chromium-dev
Garbage collection happens automatically when a repository has too many packs or too many unpacked objects, and is supposed to repack the repository so that condition isn't true any more, so it shouldn't keep happening :)

Do you perhaps have a pre-auto-gc hook in one of your repositories that is causing the gc to get cancelled? There are various scripts floating around which cancel auto-gc when your laptop is on battery, and some versions of that script don't work correctly on non-laptops and end up cancelling auto-gc every time. Look in .git/hooks and see if you have a "pre-auto-gc" in there.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

James Cook

unread,
Dec 18, 2014, 1:57:56 PM12/18/14
to Torne (Richard Coles), chromium-dev
Nope, I don't have any hooks.

I've also run "git gc" manually and that doesn't seem to help.

Could it be related to having all the branches available? Can I drop them somehow?

James

Torne (Richard Coles)

unread,
Dec 18, 2014, 2:03:29 PM12/18/14
to James Cook, Chromium-dev

What does git count-objects -v say?

James Cook

unread,
Dec 18, 2014, 3:44:56 PM12/18/14
to Torne (Richard Coles), Chromium-dev
jamescook@rubella2:/w/chrome/src$ git count-objects -v -H
count: 14486
size: 135.07 MiB
in-pack: 3514632
packs: 12
size-pack: 2.46 GiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

Michael Moss

unread,
Dec 18, 2014, 5:42:13 PM12/18/14
to James Cook, Torne (Richard Coles), Chromium-dev
Is it possible you're low on disk space and the gc is constantly failing? gc creates a temp pack file that basically doubles the size of your .git/objects/ directory before it's done and finally removes the old packs. So if you have 2.46 GB of objects, but not 2.46 GB of free space, it might be dying trying to create the new pack.

James Cook

unread,
Dec 18, 2014, 8:30:05 PM12/18/14
to Michael Moss, Torne (Richard Coles), Chromium-dev
I've got 34 GB of disk free, so I don't think I'm out of space.

I also tried "git gc --aggressive" and that didn't change things.

I'm at a loss.  Maybe it's time to blow away my checkout and start over.

James

Torne (Richard Coles)

unread,
Dec 19, 2014, 5:57:17 AM12/19/14
to James Cook, Michael Moss, Chromium-dev
Some config option possibly? What does "git config -l" say?

If you don't have any stashes that you need, a big hammer would be:
git reflog expire --expire=all --all && git repack -ad && git prune --expire now

This *should* leave you with 0 objects and 1 pack, generally...

James Cook

unread,
Dec 19, 2014, 3:17:00 PM12/19/14
to Torne (Richard Coles), Michael Moss, Chromium-dev
I ended up just deleting my repository and starting over. Thanks for the debugging help, though!

James

Michael Jablecki

unread,
May 26, 2015, 10:34:40 AM5/26/15
to chromi...@chromium.org, jame...@chromium.org, mm...@chromium.org, to...@chromium.org
I realize this is an old post, but if anyone else stumbles upon it, I found a potential solution:

git gc --prune=now

Reply all
Reply to author
Forward
0 new messages