Getting a revision number from git

I needed an atomic revision number from git, so I decided to use ‘git bisect’ for now. You’ll need the commit hash for the very first commit in the repository:
[bash]
> git bisect start
> git bisect bad HEAD
> git bisect good [hash]
Bisecting: 451 revisions left to test after this (roughly 9 steps)
[bc650f51650c208cf96eea6324dfb6564c86d099] Maintenance options
> git bisect reset
[/bash]
Then you can parse that. Works good enough for me! Of course, it’ll be good if you can tag that very first commit, you can use that as the reference point.