Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH] cg-commit: Fix a typo that would inhibit running of post-commit script:

From: Jim Meyering <hidden>
Date: 2016-06-15 22:42:37
Subsystem: the rest · Maintainer: Linus Torvalds

I tried cg-commit with a commit hook, but the hook never ran.
The problem was a typo:

Fix a typo that would inhibit running the post-commit script:
s/commit-post/post-commit/.

Signed-off-by: Jim Meyering <redacted>
---
 cg-commit |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/cg-commit b/cg-commit
index 9d3b1a1..82eea60 100755
--- a/cg-commit
+++ b/cg-commit
@@ -604,15 +604,16 @@ if [ "$newhead" ]; then
 		branchname="$(cat "$_git/branch-name")"
 	fi
 	[ -z "$branchname" ] && [ "$_git_head" != "master" ] && branchname="$_git_head"
-	if [ -x "$_git/hooks/post-commit" -a ! "$no_hooks" ]; then
+	post_commit="$_git/hooks/post-commit"
+	if [ -x "$post_commit" -a ! "$no_hooks" ]; then
 		if [ "$(git-repo-config --bool cogito.hooks.commit.post.allmerged)" = "true" ]; then
 			# We just hope that for the initial commit, the user didn't
 			# manage to install the hook yet.
 			for merged in $(git-rev-list $newhead ^$oldhead | tac); do
-				"$_git/hooks/post-commit" "$merged" "$branchname"
+				"$post_commit" "$merged" "$branchname"
 			done
 		else
-			"$_git/hooks/post-commit" "$newhead" "$branchname"
+			"$post_commit" "$newhead" "$branchname"
 		fi
 	fi
 
-- 
1.4.1.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help