AnsFourtyTwo
AnsFourtyTwo

Reputation: 2518

How to find commit of first release in Git repository

I am trying to analyze influences, e.g. commit rate, on the duration until the first release of a software repositories on github.

I found out that using the Github API is not a good idea as most of the repository do not use this functionality of github.

My second idea was to use the information in tags, but it seems that tags are not named consistently through different repositories, e.g. you could have following tags:

Of course I could use regular expression to filter out relevant tags, but I wonder if there is a more convinient way to get releases, especially the first release of a repository.

Upvotes: 0

Views: 238

Answers (1)

EncryptedWatermelon
EncryptedWatermelon

Reputation: 5598

There has to be a better way. Paging @torek

for x in `git tag`; do
  TAG=`git log -n1 --pretty="%cd %h" --date=iso refs/tags/$x`
  LIST=`echo -e "${TAG}\n${LIST}"
done
echo "${LIST}" | sort -M --reverse | uniq | tail -n1 | awk '{print $4}'| xargs git describe --tags

Upvotes: 1

Related Questions