[Lazarus] How do you guys extract an SVN revision number from a Git commit ref?
vfclists at gmail.com
Thu Mar 26 11:42:55 CET 2015
On 26 March 2015 at 09:46, Graeme Geldenhuys <mailinglists at geldenhuys.co.uk>
> On 2015-03-26 05:47, vfclists . wrote:
> > 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`
> Didn't the following work for you? It extracts exactly what you want and
> will work on any commit, no matter how long the commit message, and only
> uses built-in git functionality.
> git svn find-rev $(git log --max-count 1 --pretty=format:%H)
> The "find-rev" needs a SHA1 value, which is what the second part of the
> command (in brackets) does. So if the above command doesn't work in your
> script as one command, simply split it into two.
'git svn find-rev' works for finding the Git commit refs from subversion
refs only if the subversion refs are of the form rNNNNN, and I thought
going the other way, ie finding subversion refs from git refs wouldn't work
as Lazarus uses NNNNN rather than expected NNNNN.
I guess that is probably taken care of during the mirroring process.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Lazarus