Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    git describe --tags --always --dirty="-dev"
This will give you just the tag name if the current commit is tagged (useful for version tags), otherwise TAG-N-COMMIT, where N is the number of commits since TAG, and finally append -dev if the tree is dirty.


Almost what I've been doing but I didn't know about the "dirty" option so I had a script I wrote to check if there are uncommitted changes and append a suffix like you do. Now I can get rid of that. Thanks.


Thanks! Updating all my build scripts now.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: