[Lazarus] How do you guys extract an SVN revision number from a Git commit ref?

vfclists . vfclists at gmail.com
Tue Mar 24 22:10:16 CET 2015


I am using this code to obtain the SVN revision of a git commit hash. The
example below is for the latest commit hence the git log -n 1.

git log -n 1 | head -n 7 | tail -n 1 | cut -d "@" -f 2 | cut -d " " -f 1

It checks for the seventh line, searches for the '@' in trunk at NNNNN and
extracts it from there.
The problem is the position the line with the trunk at NNNNN string varies. Is
there some way to work it calculate it?

My awk, grep and sed skills are not so hot.

-- 
Frank Church

=======================
http://devblog.brahmancreations.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150324/411ee617/attachment-0002.html>


More information about the Lazarus mailing list