Skip to content

Instantly share code, notes, and snippets.

@HenrikBengtsson
Created January 11, 2017 00:32
Show Gist options
  • Save HenrikBengtsson/95971bc0446f3e30a7e1b899e53380d5 to your computer and use it in GitHub Desktop.
Save HenrikBengtsson/95971bc0446f3e30a7e1b899e53380d5 to your computer and use it in GitHub Desktop.
A one-line version of the SVN-REVISION hack on https://github.com/wch/r-source/wiki

A one-line version of the SVN-REVISION hack on https://github.com/wch/r-source/wiki:

printf "Revision: %s\nLast Changed Date: %s\n" `git log --format=%B -n 1 | tr '\n' ' ' | sed -E 's/.*git-svn-id: https:\/\/svn.r-project.org\/R\/[^@]*@([0-9]+).*/\1/'` `git log -1 --pretty=format:"%ad" --date=iso | sed -E 's/ .*//'` > SVN-REVISION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment