Skip to content

Commit d1536c4

Browse files
committed
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 <[email protected]>
1 parent 0fb8f9c commit d1536c4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

git-gui

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,14 @@ proc do_gitk {} {
12761276
}
12771277
}
12781278

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+
12791287
proc do_quit {} {
12801288
global gitdir ui_comm
12811289

@@ -1406,6 +1414,9 @@ menu .mbar.project
14061414
.mbar.project add command -label Visualize \
14071415
-command do_gitk \
14081416
-font $mainfont
1417+
.mbar.project add command -label {Repack Database} \
1418+
-command do_repack \
1419+
-font $mainfont
14091420
.mbar.project add command -label Quit \
14101421
-command do_quit \
14111422
-accelerator $M1T-Q \

0 commit comments

Comments
 (0)