0

I'm using git-svn on a repository which uses svn keywords like $Revision$, $Id$ and $Date$. While in general they don't have to be substituted, it would be helpful to have e.g. the correct SVN revision (obtainable via git svn find-rev $(git log FILENAME | head -n1 | awk ' { print $2 } ') if it's an actual SVN commit) put in a compiled binary. How to achieve this easily?

Tobias Kienzler
  • 25,759
  • 22
  • 127
  • 221
  • I hope, you know difference between global repository-wide revision and last-changed-revision of single file? – Lazy Badger Dec 05 '12 at 10:07
  • @LazyBadger Good point, thanks. – Tobias Kienzler Dec 05 '12 at 10:32
  • 1
    Maybe my answer to [this question](http://stackoverflow.com/questions/11534655/git-keyword-substitution-like-those-in-subversion/17242693#17242693) could be of help to you? – ShellFish May 30 '15 at 03:56
  • @ShellFish thanks, but that only works for new commits and fails at obtaining the svn revision – Tobias Kienzler May 30 '15 at 10:01
  • You can work around this issue by comitting first (without keyword expansion), then commit using script and then locally revert last commit. This will re sub the keywords. I'll check it out later te update the script so it restores keywords automatically after commit (check back in a week or 2, when my exams are over). – ShellFish May 30 '15 at 11:57

0 Answers0