aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-06-21 15:12:49 +0200
committerMatěj Cepl <mcepl@cepl.eu>2024-10-07 11:02:09 +0200
commitd18be7283b483cde0e270d3ab2e1ffea38300e1b (patch)
tree3eb9937728e3913166dec70f28a41554e7135df5
parent7aa80faf4b655a82af3860bf8689eff333fffbb5 (diff)
downloadgosc-d18be7283b483cde0e270d3ab2e1ffea38300e1b.tar.gz
feat(git-which-tag): print also subject line of found commits
Both for control and to find additional information.
-rwxr-xr-xgit-which-tag.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-which-tag.sh b/git-which-tag.sh
index b5d7390..0ccb719 100755
--- a/git-which-tag.sh
+++ b/git-which-tag.sh
@@ -6,7 +6,8 @@ set -eu
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 | tr '\n' ' ')"
+ subject="$(git rev-list --max-count=1 --no-commit-header --format=%s "$ID")"
if [ -n "$tags" ] ; then
- printf "%s: %s\n" "$ID" "$tags"
+ printf "%s: %s %s\n" "$ID" "$tags" "$subject"
fi
done