I am in the process of migrating my VCS from Subversion to Git. When I used Subversion, I used to use the Subversion revision number as the last component of my assembly versions. In TeamCity, I used %build.vcs.number%
as part of the build number format and I used the 'AssemblyInfo Patcher' (or sometimes MSBuild Community Tasks) to update my AssemblyVersion attributes with the version number prior to compiling. This all worked rather well and made it easy to track any given assembly back to the exact source revision.
Unfortunately in Git, there are no longer revision numbers. Instead we have the long hexadecimal hash code which can't be used within an AssemblyVersion. This is the one thing so far that I lament about changing to Git.
Is there a way to retrieve a simple numeric version identifier from Git that I could use in my build configurations as described above?