Skip to content

Commit

Permalink
Update git-tag-version
Browse files Browse the repository at this point in the history
Don't rely on `git tag --merged` since it's a git 2.7 feature
  • Loading branch information
jola5 committed Aug 11, 2017
1 parent 566ef37 commit dab9444
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/git-tag-version
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function version() {

# get current version tag and print its name, return 'none' if no version tag exists
function get-current-version-tag() {
TAG=$(git tag --list 'v*' -n1 --merged | grep -E "^v[0-9]+.[0-9]+.[0-9]+.*\s+version [0-9]+.[0-9]+.[0-9]+" | tail -n1 | cut -d" " -f1)
TAG=$(git log --oneline --decorate=short | grep -E "tag: v[0-9]+\.[0-9]+\.[0-9]" | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+[^,\)]*" | xargs git tag --list {} -n1 | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+.*\s+version [0-9]+\.[0-9]+\.[0-9]+" | tail -n1 | cut -d" " -f1)

if [ -z "$TAG" ]; then
TAG="none"
Expand Down

0 comments on commit dab9444

Please sign in to comment.