visionmedia / deploy

Minimalistic deployment shell script
1.15k stars 137 forks source link

Logic to sort the tags was wrong. #21

Closed paramaggarwal closed 10 years ago

paramaggarwal commented 10 years ago

Currently the way the tags are sorted is some random order. See the difference below.

Current way of sorting: --sort=-authordate

$ git for-each-ref refs/tags --sort=-authordate --format='%(refname)'
refs/tags/v0.1.10
refs/tags/v0.1.7
refs/tags/v0.1.6
refs/tags/v0.1.4
refs/tags/v0.1.13
refs/tags/v0.1.2
refs/tags/v0.1.3
refs/tags/v0.1.5
refs/tags/v0.1.8
refs/tags/v0.1.0
refs/tags/v0.1.9
refs/tags/v0.1.1
refs/tags/v0.1.11
refs/tags/v0.1.12

After the fix: --sort=-*authordate

$ git for-each-ref refs/tags --sort=-*authordate --format='%(refname)'
refs/tags/v0.1.13
refs/tags/v0.1.12
refs/tags/v0.1.11
refs/tags/v0.1.9
refs/tags/v0.1.8
refs/tags/v0.1.5
refs/tags/v0.1.3
refs/tags/v0.1.2
refs/tags/v0.1.1
refs/tags/v0.1.0
refs/tags/v0.1.10
refs/tags/v0.1.6
refs/tags/v0.1.4
refs/tags/v0.1.7
tj commented 10 years ago

what does the star do?

paramaggarwal commented 10 years ago

Tags do not have an author date. The commit they point to has it. The asterisk denotes the same.

From https://www.kernel.org/pub/software/scm/git/docs/git-for-each-ref.html:

If fieldname is prefixed with an asterisk (*) and the ref points at a tag object, the value for the field in the object the tag refers is used.

TJ, thanks a lot for your work on Jade, Express and deploy. I use them regularly at work/play and love them.