From 62977ea23a68e3da6da0183b858abd38c3c0ec9f Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 8 Feb 2015 16:29:23 +0100 Subject: SC2112 'function' keyword is non-standard. Delete it. http://www.shellcheck.net/ [ci skip] --- tools/prepare-commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/prepare-commit-msg b/tools/prepare-commit-msg index ab351760..e8150dd1 100755 --- a/tools/prepare-commit-msg +++ b/tools/prepare-commit-msg @@ -5,7 +5,7 @@ # Add [ci skip] to the commit message unless there are changes to files # that are relevant for testing such as src/*, test/*, ledger3.texi, ... -function add_ci_skip() +add_ci_skip () { pattern="$1"; shift source="$1" -- cgit v1.2.3 From a60ff5dc22d4aca9fdba000c9c928f4ae38adae4 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 8 Feb 2015 16:31:26 +0100 Subject: SC2069 The order of the 2>&1 and the redirect matters. The 2>&1 has to be last. http://www.shellcheck.net/ [ci skip] --- tools/prepare-commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/prepare-commit-msg b/tools/prepare-commit-msg index e8150dd1..5045fe7a 100755 --- a/tools/prepare-commit-msg +++ b/tools/prepare-commit-msg @@ -11,7 +11,7 @@ add_ci_skip () source="$1" # Don't add [ci skip] if it's already in the commit message source - grep '\[ci skip\]' "$source" 2>&1 >/dev/null + grep '\[ci skip\]' "$source" >/dev/null 2>&1 [ $? -eq 0 ] && return if [ $(git diff --cached --name-only | grep --count "$pattern") -eq 0 ]; then -- cgit v1.2.3 From 9d82674c889a831418a792ba6505e57c8d4ca225 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 8 Feb 2015 16:33:40 +0100 Subject: SC2086 Double quote to prevent globbing and word splitting. http://www.shellcheck.net/ [ci skip] --- tools/prepare-commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/prepare-commit-msg b/tools/prepare-commit-msg index 5045fe7a..585b5397 100755 --- a/tools/prepare-commit-msg +++ b/tools/prepare-commit-msg @@ -15,7 +15,7 @@ add_ci_skip () [ $? -eq 0 ] && return if [ $(git diff --cached --name-only | grep --count "$pattern") -eq 0 ]; then - tempfile=$(mktemp $0.XXXXXX) + tempfile=$(mktemp "$0".XXXXXX) cat - "$1" < "$tempfile" # It seems the changes to be committed are irrelevant for the continuous -- cgit v1.2.3 From c397f6f53af170598872ec4620f1356d8bbcdea7 Mon Sep 17 00:00:00 2001 From: thdox Date: Tue, 10 Feb 2015 21:29:00 +0100 Subject: Improve quoting [ci skip] --- tools/prepare-commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/prepare-commit-msg b/tools/prepare-commit-msg index 585b5397..d2f927c0 100755 --- a/tools/prepare-commit-msg +++ b/tools/prepare-commit-msg @@ -15,7 +15,7 @@ add_ci_skip () [ $? -eq 0 ] && return if [ $(git diff --cached --name-only | grep --count "$pattern") -eq 0 ]; then - tempfile=$(mktemp "$0".XXXXXX) + tempfile=$(mktemp "${0}.XXXXXX") cat - "$1" < "$tempfile" # It seems the changes to be committed are irrelevant for the continuous -- cgit v1.2.3