Most developers jumping from svn to git, miss the SVN revision numbers, using the svn info command. SVN automatically increment a unique revision number on every commit, independent of the number of times, code compiled or build. This unique revision number was used by developers to version their binaries and uniquely identify the version of their apps.
Sample script to provide revision number in svn:
#!/bin/sh
rev=`svn info | grep Revision | awk '{print $2;}'`
rev=`svn info | grep Revision | awk '{print $2;}'`
Git doesn't uses or produce any unique automatic increment number on commit, instead it produces a hash value, which is useless for versioning purpose.
But the solution is simple, as explained by the Michael Dales on his blog, to tag the start point – either on the first commit to the repository or the commit just after you’ve forked for a release. Now, to get a simple increasing revision number for a particular commit anywhere in the tree you take the object you’re interested in and count the steps back until you hit a version start tag, and you’re done.
More Information: http://michaelandlaura.org.uk/~michael/blog/index.php?id=379
But the solution is simple, as explained by the Michael Dales on his blog, to tag the start point – either on the first commit to the repository or the commit just after you’ve forked for a release. Now, to get a simple increasing revision number for a particular commit anywhere in the tree you take the object you’re interested in and count the steps back until you hit a version start tag, and you’re done.
More Information: http://michaelandlaura.org.uk/~michael/blog/index.php?id=379
