diff options
-rw-r--r-- | README.md | 7 | ||||
-rwxr-xr-x | git-which-tag.sh | 12 |
2 files changed, 17 insertions, 2 deletions
@@ -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 |