I love the idea of this gem, it solves a number of important issues, and even should work with heroku.
What I don't get is how it can work with a version.txt file.
If it saves the file before the commit, then it doesn't know the version number to put in the file
If it saves the file after the commit, then the file isn't saved as part of the commit, so a push to somewhere (e.g. heroku) will not include that file, and the version.txt will be off!
/Users/humblepatience/.rvm/gems/ruby-1.9.2-p290/gems/git-version-0.0.2/lib/git-version/engine.rb:3:in <class:Engine>': undefined methodisolate_namespace' for GitVersion::Engine:Class (NoMethodError)
from /Users/humblepatience/.rvm/gems/ruby-1.9.2-p290/gems/git-version-0.0.2/lib/git-version/engine.rb:2:in <module:GitVersion>' from /Users/humblepatience/.rvm/gems/ruby-1.9.2-p290/gems/git-version-0.0.2/lib/git-version/engine.rb:1:in<top (required)>'
from /Users/humblepatience/.rvm/gems/ruby-1.9.2-p290/gems/git-version-0.0.2/lib/git-version.rb:2:in require' from /Users/humblepatience/.rvm/gems/ruby-1.9.2-p290/gems/git-version-0.0.2/lib/git-version.rb:2:in<top (required)>'
Itβs important to notice that it isnβt the SHA of the commit, but of the blob itself.
I've looked around for a while and I don't have any suggestions, unfortunately. The smudge/clean filters are viable if you can control git-config everywhere, and I don't think you can do that on Heroku. export-subst could be an option if Heroku uses git-archive but it doesn't look like they do: https://devcenter.heroku.com/articles/slug-compiler (I haven't tested this.)