When I run 'git gui' I get a popup that says
This repository currently has approximately 1500 loose objects.
It then suggests compressing the database. I've done this before, and it reduces the loose objects to about 250, but that doesn't suppress the popup. Compressing again doesn't change the number of loose objects.
Our current workflow requires significant use of 'rebase' as we are transitioning from Perforce, and Perforce is still the canonical SCM. Once Git is the canonical SCM, we will do regular merges, and the loose objects problem should be greatly mitigated.
In the mean time, I'd really like to make this 'helpful' popup go away.
When "Loose Object" popup I know it's time to run git's garbage collector:
After that the popup goes away.
Update: (due to T.E.D.'s suggestion)
I extracted the below routine from
git/share/git-gui/lib/database.tcl
You can modify it to meet your needs.
Since nobody had yet an answer, I looked into the code to see how to remove the code which shows up that dialog. I found the
hint_gc
procedure which does it and the place where it is called. At the same time I noticed that late 2011 there was added a configuration option for disabling the dialog. This change (part of git-gui 0.16.0) was merged to Git's mainline on 2011-12-14.So if you use Git v1.7.9 or newer, you can disable the warning dialog with the following command:
If you are using an older version, then you can edit
/lib/git-core/git-gui
and remove theafter 1000 hint_gc
line, or edit/usr/share/git-gui/lib/database.tcl
and remove the body of thehint_gc
procedure. (These file paths are on Cygwin - on other environments the files might be in a different locations. For Windows it isc:\Program Files\Git\mingw64\libexec\git-core\git-gui.tcl
)Update:
git prune
would "solve" the issue, in that it will remove those loose objects(
git gc
callsgit prune
, but only for loose objects older than two weeks, by default).However, as the OP Michael Donohue mentions in the comments:
Original answer:
The problem of "
git gc
" not removing all loose objects has been reported before (late 2008, ""git gc
" doesn't seem to remove loose objects any more"So in your case, would a "
git prune
" be helpful?(possibly with using "now" in the
gc.pruneexpire
config variable, needed for the above behavior to happen).You also have (from the same thread):
Hmmmm....I don't see a command-line argument for that in the docs.
I suppose you could always pull down its source, take out the code for the dialog, and rebuild.