aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md7
-rwxr-xr-xgit-which-tag.sh12
2 files changed, 17 insertions, 2 deletions
diff --git a/README.md b/README.md
index 2896a95..b129edb 100644
--- a/README.md
+++ b/README.md
@@ -8,10 +8,13 @@ git-oci
: prepare commit message from `*.changes` file
goscb
-: (probably not needed, when the checkout is primed with `git-obranch`) run `osc build` without regards if `.osc/` directory exists.
+: (probably not needed, when the checkout is primed with `git-obranch`) run `osc build` without regards if `.osc/` directory exists
git-format-named-patches.sh
-: similar to `git format-patch` except the patch files are named according to `Patch: ` trailer in the commit message.
+: similar to `git format-patch` except the patch files are named according to `Patch: ` trailer in the commit message
+
+git-which-tag.sh
+: list at most five tags containing commits identified by string in the commit message
All issues, questions, complaints, or (even better!) patches
should be send via email to
diff --git a/git-which-tag.sh b/git-which-tag.sh
new file mode 100755
index 0000000..b2665f5
--- /dev/null
+++ b/git-which-tag.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -eu
+
+[ "$#" -lt 1 ] && exit 1
+
+git log --color=never --all --pretty='%h' --grep="${1}" | while read -r ID ; do
+ tags="$(git tag --no-column -l 'v*' --sort='version:refname' --contains "$ID" \
+ | head -n 5)"
+ if [ -n "$tags" ] ; then
+ printf "%s: %s\n" "$ID" "$tags"
+ fi
+done