Skip to contentSkip to conversation

git-gui: run auto maintenance on commit

PATCH New Wolfgang Faust 1 participant 1 message Mar 6 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/4 git-gui: run auto maintenance on commit

This implements the same behavior as seen in builtin/commit.c:
run auto maintenance between rerere and the post-commit hook.

---
This always detaches rather than honoring autoDetach (unlike run_auto_maintenance()) because I can't think of a circumstance where you'd want the GUI to block.

 git-gui/lib/commit.tcl | 6 ++++++
 1 file changed, 6 insertions(+)
git-gui/lib/commit.tcl +6 -0
index 89eb8c7b73..4b07cb3bbb 100644
@@ -477,6 +477,12 @@ A rescan will be automatically started now.
 		catch {git rerere}
 	}
 
+	# -- Run auto maintenance (e.g. garbage collection)
+	#
+	if {[is_config_true maintenance.auto]} {
+		catch {exec git maintenance run --auto --quiet --detach}
+	}
+
 	# -- Run the post-commit hook.
 	#
 	set fd_ph [githook_read post-commit]
Signature · 1 line
2.52.0