Last active
August 29, 2015 14:02
-
-
Save corpix/d9855390b38972b38a71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Helpers for current branch tagging | |
function get_filetered_branch_repr {echo `git rev-parse --abbrev-ref HEAD` | sed 's/\//-/g'}; | |
function get_last_tag {git tag | grep `get_filetered_branch_repr` | sort -r | head -n 1}; | |
function get_incremented_tag { | |
get_last_tag | \ | |
python -c "for line in __import__('sys').stdin: l=line.split('-');v=l[-1].rstrip().split('.');v[-1]=str(int(v[-1])+1);print '-'.join(l[:-1]+['.'.join(v)])" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment