From d1536c488e2f410c9f622356e29d9a5870d2403f Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 7 Nov 2006 20:40:35 -0500 Subject: [PATCH] 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 --- git-gui | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/git-gui b/git-gui index 83f713535f..eb7329c218 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 \ -- 2.11.4.GIT