From: Shawn O. Pearce Date: Wed, 8 Nov 2006 01:40:35 +0000 (-0500) Subject: git-gui: Added repack database menu option, to invoke git repack. X-Git-Tag: gitgui-0.6.0~278 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d1536c488e2f410c9f622356e29d9a5870d2403f;p=git.git git-gui: Added repack database menu option, to invoke git repack. Most users of git-gui probably shouldn't be invoking git repack directly; instead we should be looking at how many loose objects they have and how many active packs they have and making the decision for them. But that's more work to code, and there's always going to be discussion about what is the right default threshold and how do we know that the user is willing to do the repack when we decide its time, etc. So instead we'll just keep it simple and offer up the menu option. Unfortunately right now we get now progress indication back from git-pack-objects as its being invoked not through a tty, which makes it disable progress output and the git-repack.sh wrapper won't let us pass through --progress. Signed-off-by: Shawn O. Pearce --- diff --git a/git-gui b/git-gui index 83f713535..eb7329c21 100755 --- a/git-gui +++ b/git-gui @@ -1276,6 +1276,14 @@ proc do_gitk {} { } } +proc do_repack {} { + set w [new_console "repack" "Repacking the object database"] + set cmd [list git repack] + lappend cmd -a + lappend cmd -d + console_exec $w $cmd +} + proc do_quit {} { global gitdir ui_comm @@ -1406,6 +1414,9 @@ menu .mbar.project .mbar.project add command -label Visualize \ -command do_gitk \ -font $mainfont +.mbar.project add command -label {Repack Database} \ + -command do_repack \ + -font $mainfont .mbar.project add command -label Quit \ -command do_quit \ -accelerator $M1T-Q \