From d18be7283b483cde0e270d3ab2e1ffea38300e1b Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 21 Jun 2024 15:12:49 +0200 Subject: feat(git-which-tag): print also subject line of found commits Both for control and to find additional information. --- git-which-tag.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit