Emulate subwcrev when using git-svn Emulate subwcrev when using git-svn bash bash

Emulate subwcrev when using git-svn


I don't really get your points, but start to improve your script first.

revision=$(grep -Po "(?<=Revision: ).*" svninfo)lastchange=$(grep -Po "(?<=Last Changed Rev: ).*" svninfo)# Get the last changed date, extract timestamp, replaces dashes with slasheschangedate=$(grep -Po "(?<=Last Changed Date: ).{19}" svninfo)changedate=${changedate//-//}now=$(date "+%Y\/%m\/%d %H:%M:%S")

Then, in for loop, could you please explain detail, what result you need? Can you show one sample of svnversion_template.h ?


So it looks like you might have to parse the contents of the git svn info query yourself to get what is normally stored in WCREV. The example results look like this for me:

git svn infoPath: .URL: http://myurl.com/trunk/myrepoRepository Root: http://myurl.comRepository UUID: 15fed3e9-81ce-ef4a-a7da-fc36e3df1edcRevision: 14106Node Kind: directorySchedule: normalLast Changed Author: myusernameLast Changed Rev: 14106Last Changed Date: 2015-05-29 10:23:10 -0400 (Fri, 29 May 2015)

Now for the second part of your question, whether or not you can tell if your git HEAD matches the latest svn checkout, you'll need to use the command git diff git-svn command. "git-svn" here is the name of the branch that the git-svn program is maintaining, and if everything is up to date, the results will be empty.