From: Nicolas Pitre Date: Mon, 19 Oct 2009 01:15:36 GMT Subject: Re: Creating something like increasing revision numbers Message-ID: In-Reply-To: <200910181923.19511.johan@herland.net> On Sun, 18 Oct 2009, Johan Herland wrote: > On Sunday 18 October 2009, Norbert Preining wrote: > > On So, 18 Okt 2009, Johan Herland wrote: > > > $ git describe > > > v1.0.4-14-g2414721 > > > > > > where the "v1.0.4" part is the last tag that the current state is based > > > on, the "14" part is the number of commit between that tag and the > > > current > > > > So if we have only one tag (initial) then it would count the number > > of commits? > > Yes. You can create the 'initial' tag with > > git rev-list HEAD | tail -n1 | xargs git tag initial > > and from then on > > git describe --tags --match initial | cut -d'-' -f2 Even simpler, without any tag: git rev-list HEAD | wc -l That should roughly give the equivalent of the SVN revision number. Valid only in one specific repository of course. Nicolas