git-gui: Allow users to run fsck-objects from the gui.
I recently found a need to run fsck-objects in a number of repositories that I also use git-gui against. Tossing in a menu option to invoke fsck-objects and have its output show up in a console window is simple enough to do. We probably need to enhance the console window used by fsck-objects, like to open up the Git fsck-objects manual page and let the user see what each message means (such as "dangling commit") and to also let the user invoke prune, to cleanup any such dangling objects. But right now I'm going to ignore that problem in favor of getting other more important features implemented. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Nov 20, 2006 at 21:43 UTC
444f92d097425e8d1043a14571ebfd82c1c3b0a5
1 file changed
+13
git-gui
+13
@@ -1954,6 +1954,15 @@ proc do_repack {} {
1954
console_exec $w $cmd
1955
}
1956
1957
+proc do_fsck_objects {} {
1958
+ set w [new_console "verify" "Verifying the object database"]
1959
+ set cmd [list git fsck-objects]
1960
+ lappend cmd --full
1961
+ lappend cmd --cache
1962
+ lappend cmd --strict
1963
+ console_exec $w $cmd
1964
+}
1965
+
1966
set is_quitting 0
1967
1968
proc do_quit {} {
@@ -2610,6 +2619,10 @@ if {!$single_commit} {
2619
-command do_repack \
2620
-font font_ui
2621
2622
+ .mbar.project add command -label {Verify Database} \
2623
+ -command do_fsck_objects \
2624
+ -font font_ui
2625
+
2626
if {$tcl_platform(platform) eq {windows}} {
2627
.mbar.project add command \
2628
-label {Create Desktop Icon} \