summaryrefslogtreecommitdiffstats
path: root/git-buildmsg/print-buildmsg.c
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2007-11-10 17:06:12 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2007-11-10 17:06:12 +0100
commit2319e65dbffeb1c6654239a58a4e17dde0380a5f (patch)
tree6dded019ca936b2ea3f25336abb35cf03bbb30b9 /git-buildmsg/print-buildmsg.c
parentff93e51a4ae4f8fefeb7a49eaafc8ba4ff2c52e2 (diff)
downloadndim-git-utils-2319e65dbffeb1c6654239a58a4e17dde0380a5f.tar.gz
ndim-git-utils-2319e65dbffeb1c6654239a58a4e17dde0380a5f.tar.xz
ndim-git-utils-2319e65dbffeb1c6654239a58a4e17dde0380a5f.zip
Demonstrate "dist-of-git-commit" message
It is certainly possible to do that in a cleaner way with less code, but at least this works.
Diffstat (limited to 'git-buildmsg/print-buildmsg.c')
-rw-r--r--git-buildmsg/print-buildmsg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/git-buildmsg/print-buildmsg.c b/git-buildmsg/print-buildmsg.c
new file mode 100644
index 0000000..c5f4e84
--- /dev/null
+++ b/git-buildmsg/print-buildmsg.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include <string.h>
+#include "git-buildmsg.h"
+
+int main(int argc, char *argv[])
+{
+ const char *const lastslash = strrchr(argv[0], '/');
+ const char *const self = (lastslash)?(lastslash+1):(argv[0]);
+ printf("%s: %s\n", self, GIT_MESSAGE);
+ return 0;
+}