mdomke / git-semver

Semantic Versioning with git tags
MIT License
107 stars 20 forks source link

gtg-min alias definition resolves tag permanently #43

Open nathanperkins opened 3 weeks ago

nathanperkins commented 3 weeks ago

Using double-quotes to define the gtg-min alias causes the tag to be permanently resolved when defining the alias, rather than when the alias is called.

$ alias gtg-min="git tag -s -a $(git-semver -target minor)"
$ alias gtg-min
alias gtg-min='git tag -s -a 0.2.0'

Then, calling the alias multiple times uses the same tag and fails:

$ gtg-min
fatal: tag '0.2.0' already exists

Using single-quotes fixes the issue:

$ alias gtg-min='git tag -s -a $(git-semver -target minor)'
$ alias gtg-min
alias gtg-min='git tag -s -a $(git-semver -target minor)'

Seems like pretty standard bash behavior but in case the version is interesting:

$ bash --version
GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
nathanperkins commented 3 weeks ago

Out for review: #44