[Lazarus] How do you guys extract an SVN revision number from a Git commit ref?
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Lazarus