<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 24 March 2015 at 23:33, Graeme Geldenhuys <span dir="ltr"><<a href="mailto:mailinglists@geldenhuys.co.uk" target="_blank">mailinglists@geldenhuys.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 2015-03-24 21:10, vfclists . wrote:<br>
><br>
> git log -n 1 | head -n 7 | tail -n 1 | cut -d "@" -f 2 | cut -d " " -f 1<br>
<br>
<br>
</span>Try:<br>
<br>
  git svn find-rev $(git log --max-count 1 --pretty=format:%H)<br>
<br>
<br>
Alternatively you could do something like this:<br>
<br>
  git log -n 1 -z | grep "trunk@[0-9]* "<br>
<br>
Tweak the regex to use lookbehind which could then trim the "trunk@"<br>
prefix. I don't know the regex syntax for grep. The following regex does<br>
the trick in my editor of choice, but not in the command above for some<br>
reason.<br>
<br>
  (?<=trunk@)[0-9]+<br>
<br>
<br>
<br>
Regards,<br>
  - Graeme -<br>
<span class=""><font color="#888888"></font></span><br clear="all"></blockquote></div><br><br></div><div class="gmail_extra">This is what I have settled on in the mean time.<br><br>LAZ_SVN_REVISION=`git log  | grep -A 10 $LAZ_GIT_REVISION | grep git-svn-id |  cut -d "@" -f 2 | cut -d " " -f 1`<br><br></div><div class="gmail_extra">It searches the commit log for the 10 lines after the git commit ref , looks for the line saying git-svn-id and gets the part after the '@' at sign. It needs more refinement though.<br><br></div><div class="gmail_extra">-- <br><div class="gmail_signature">Frank Church<br><br>=======================<br><a href="http://devblog.brahmancreations.com">http://devblog.brahmancreations.com</a></div>
</div></div>