getver.sh: cope with varying "git log" line formats to reliably extract the git-svn...
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 26 Oct 2011 14:54:57 +0000 (14:54 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 26 Oct 2011 14:54:57 +0000 (14:54 +0000)
SVN-Revision: 28604

scripts/getver.sh

index cd9b90a4bd5d232178eab7e8fbb8677e3712471f..8bb384bd538fbc4a3a249d666cd8dc216e7fb63d 100755 (executable)
@@ -18,7 +18,7 @@ try_svn() {
 
 try_git() {
        [ -d .git ] || return 1
-       REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $2); print $2 }')"
+       REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $0); print $1 }')"
        REV="${REV:+r$REV}"
        [ -n "$REV" ]
 }