git-gui: Added post-commit invocation after the commit is done.
Since git-commit.sh invokes hooks/post-commit after running git rerere we should do the same if its available and executable. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Nov 12, 2006 at 18:08 UTC
c8ebafd84537473bb8a53880a6a6740d723b83bc
1 file changed
+16
-1
git-gui
+16
-1
@@ -793,7 +793,7 @@ proc commit_stage2 {curHEAD msg} {
793
}
794
795
proc commit_stage3 {fd_wt curHEAD msg} {
796
- global single_commit gitdir HEAD PARENT commit_type
796
+ global single_commit gitdir HEAD PARENT commit_type tcl_platform
797
global ui_status_value ui_comm
798
global file_states
799
@@ -870,6 +870,21 @@ proc commit_stage3 {fd_wt curHEAD msg} {
870
catch {exec git rerere}
871
}
872
873
+ # -- Run the post-commit hook.
874
+ #
875
+ set pchook [file join $gitdir hooks post-commit]
876
+ if {$tcl_platform(platform) == {windows} && [file isfile $pchook]} {
877
+ set pchook [list sh -c [concat \
878
+ "if test -x \"$pchook\";" \
879
+ "then exec \"$pchook\";" \
880
+ "fi"]]
881
+ } elseif {![file executable $pchook]} {
882
+ set pchook {}
883
+ }
884
+ if {$pchook != {}} {
885
+ catch {exec $pchook &}
886
+ }
887
+
888
$ui_comm delete 0.0 end
889
$ui_comm edit modified false
890
$ui_comm edit reset