1
0
mirror of https://github.com/git/git.git synced 2024-09-30 19:33:01 +02:00
Git Source Code Mirror. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
Go to file
Shawn O. Pearce d164b7548a git-gui: Change our initial GC hint to be an estimate
Instead of running a full git-count-objects to count all of the loose
objects we can get a reasonably close approximation by counting the
number of files in the .git/objects/42 subdirectory. This works out
reasonably well because the SHA-1 hash has a fairly even distribution,
so every .git/objects/?? subdirectory should get a relatively equal
number of files.  If we have at least 8 files in .git/objects/42 than it
is very likely there is about 8 files in every other directory, leaving
us with around 2048 loose objects.

This check is much faster, as we need to only perform a readdir of
a single directory, and we can do it directly from Tcl and avoid the
costly fork+exec.

All of the credit on how clever this is goes to Linus Torvalds; he
suggested using this trick in a post commit hook to repack every so
often.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-17 22:49:44 -04:00
lib git-gui: Don't crash in ask_popup if we haven't mapped main window yet 2007-07-17 22:45:53 -04:00
.gitignore git-gui: Refactor into multiple files to save my sanity 2007-05-07 23:35:48 -04:00
git-gui.sh git-gui: Change our initial GC hint to be an estimate 2007-07-17 22:49:44 -04:00
GIT-VERSION-GEN Merge branch 'maint' 2007-06-11 19:06:15 -04:00
Makefile Merge branch 'maint' 2007-06-27 00:36:38 -04:00