]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
git/svn: check if our git rev corresponds to some svn rev
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 28 Aug 2007 11:47:25 +0000 (11:47 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 28 Aug 2007 11:47:25 +0000 (11:47 +0000)
bin/rbot

index 1a879380d682edc55fbcb7e827462c4a317fe004..98bc333938d2bb9168b88487b095f7b1e44c6358 100755 (executable)
--- a/bin/rbot
+++ b/bin/rbot
@@ -51,7 +51,11 @@ if $version =~ /svn/
     branch = $1.dup || "unknown"
     changed = git_out.match(/^# Change(.*)\n/)
     rev = "revision "
-    rev << `git rev-parse HEAD`[0..5]
+    git_out = `git log -1 --pretty=format:"%h%n%b"`.split("\n")
+    rev << git_out.first
+    if git_out.last.match(/^git-svn-id: \S+@(\d+)/)
+      rev << "(svn #{$1})"
+    end
     rev << ", local changes" if changed
 
     $version << " (#{branch} branch, #{rev})"