@matheusbsbs / matheus-bagliano / commits / d1536c488e
Fork 0

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 <spearce@spearce.org>

Shawn O. Pearce committed Nov 7, 2006 at 20:40 UTC d1536c488e2f410c9f622356e29d9a5870d2403f
1 file changed +11
git-gui
+11
@@ -1276,6 +1276,14 @@ proc do_gitk {} {
1276 }
1277 }
1278
1279 +proc do_repack {} {
1280 + set w [new_console "repack" "Repacking the object database"]
1281 + set cmd [list git repack]
1282 + lappend cmd -a
1283 + lappend cmd -d
1284 + console_exec $w $cmd
1285 +}
1286 +
1287 proc do_quit {} {
1288 global gitdir ui_comm
1289
@@ -1406,6 +1414,9 @@ menu .mbar.project
1414 .mbar.project add command -label Visualize \
1415 -command do_gitk \
1416 -font $mainfont
1417 +.mbar.project add command -label {Repack Database} \
1418 + -command do_repack \
1419 + -font $mainfont
1420 .mbar.project add command -label Quit \
1421 -command do_quit \
1422 -accelerator $M1T-Q \