On 24 March 2015 at 23:33, Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote:
> On 2015-03-24 21:10, vfclists . wrote: > > > > git log -n 1 | head -n 7 | tail -n 1 | cut -d "@" -f 2 | cut -d " " -f 1 > > > Try: > > git svn find-rev $(git log --max-count 1 --pretty=format:%H) > > > Alternatively you could do something like this: > > git log -n 1 -z | grep "trunk@[0-9]* " > > Tweak the regex to use lookbehind which could then trim the "trunk@" > prefix. I don't know the regex syntax for grep. The following regex does > the trick in my editor of choice, but not in the command above for some > reason. > > (?<=trunk@)[0-9]+ > > > > Regards, > - Graeme - > > This is what I have settled on in the mean time. LAZ_SVN_REVISION=`git log | grep -A 10 $LAZ_GIT_REVISION | grep git-svn-id | cut -d "@" -f 2 | cut -d " " -f 1` 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. -- Frank Church ======================= http://devblog.brahmancreations.com
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus