version.sh : fix revision in git-svn trees

"git log .. -1" only shows one commit (the last one), so extract the last line (git-svn-id:..) with tail -n 1, instead of the first line (which is the committer's message in case of multi lines body)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21188 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2009-06-04 15:05:00 +00:00
parent 2409c28f21
commit 7d1528e601

View file

@ -40,7 +40,7 @@ gitversion() {
if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
# Get the svn revision of the most recent git-svn commit
version=`git log --pretty=format:'%b' --grep='git-svn-id: svn' -1 | head -n 1 | perl -ne 'm/@(\d*)/; print "r" . $1;'`
version=`git log --pretty=format:'%b' --grep='git-svn-id: svn' -1 | tail -n 1 | perl -ne 'm/@(\d*)/; print "r" . $1;'`
mod=""
# Is this a git-svn commit?
if ! git log HEAD^.. --pretty=format:"%b" | grep -q "git-svn-id: svn" ; then