SyneRBI / SyneRBI_VM

Virtual Machine with pre-installed SyneRBI software
http://www.ccpsynerbi.ac.uk
Apache License 2.0
3 stars 7 forks source link

Sort tags #136

Closed paskino closed 5 years ago

paskino commented 5 years ago

tries to sort tags in a chronological order as output from git log

KrisThielemans commented 5 years ago

what time is %at?

paskino commented 5 years ago

it is the unix timestamp. If you use %ai you get the ISO format. However I noticed that there were some dates with different shifts from UTC. The unix timestamp is a single number.

KrisThielemans commented 5 years ago

yes, but unix timestamp of what?

paskino commented 5 years ago

The command is this git tag | xargs -I@ git log --format=format:"%at @%n" -1 @ | sort | awk '{print $2}' | tail -1

  1. you get the tags
  2. you pass the tag to git log and get only the log of that tag
git log -1 v2.0.0
commit 26b149be58ef6e54fabfc95a2a9853ce74828968 (tag: v2.0.0, origin/master, origin/HEAD)
Author: Edoardo Pasca <edo.paskino@gmail.com>
Date:   Tue May 14 14:06:09 2019 +0100

    update to version 2.0.0 (#134)

    update to version 2.0.0

The timestamp corresponds to the date of the commit to which the tag is associated (in my understanding).

KrisThielemans commented 5 years ago

for information.

%at lists the authordate. This might be the same as taggerdate but I don't know for sure. See here for difference with commitdate.

So I think this is the same as git tag --sort=taggerdate except that the latter lists lightweight tags first.

In any case, let's not use lightweight tags in future (not sure if we can prevent this, probably not)