79365333

Date: 2025-01-17 15:56:15
Score: 1
Natty:
Report link

Newest tag across all branches

newestTaggedCommit="$(git rev-list --tags --max-count=1)"
tagName="$(git describe --tags "$newestTaggedCommit")"
# Commits since tag
git log "$(git rev-list --tags --max-count=1)"..HEAD --oneline

https://stackoverflow.com/a/7979255

Newest tag on current branch

newestTagName="$(git describe --tags --abbrev=0)"
# Commits since tag
git log "$(git describe --tags --abbrev=0)"..HEAD --oneline

https://stackoverflow.com/a/12083016

git describe doesn't seem to show tags made on other branches, even if they have been merged in (so follows only the first parent of a merge).

git rev-list --tags seems to be reliable for my use case (we release from different branches).

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: SftPlnIT