summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2011-08-06 08:36:51 +0200
committerAndrea Canciani <ranma42@gmail.com>2011-08-06 08:36:51 +0200
commit0da5c7387320e2e1a922a5777a02de41c959c509 (patch)
tree00785527496f31fc79a9ec2c1e8e8341c3f82660
parent919da09f2fa1c425695659f48111009bb4e42207 (diff)
cocci: Utility script to embed a coccinelle semantic patch in a commit messageHEADmaster
The script assumes that the first line of the semantic patch is a comment which indicates the first line of the commit message.
-rwxr-xr-xcoccinelle-commit.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/coccinelle-commit.sh b/coccinelle-commit.sh
new file mode 100755
index 0000000..ca48aad
--- /dev/null
+++ b/coccinelle-commit.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# Helper script to use a Coccinelle semantic patch as a commit message
+# USAGE: coccinelle-commit.sh <your_cocci_patch> | git commit -F-
+
+head -n1 "$1" | sed 's/^\/\/[[:blank:]]*//'
+echo
+echo 'This patch has been generated by the following Coccinelle semantic patch:'
+echo
+cat "$1"