]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
launch_here: add commit subject rather than svn id to revision
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 22 Jan 2009 22:29:50 +0000 (23:29 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 23 Jan 2009 00:07:40 +0000 (01:07 +0100)
There are no git-svn-ids in our repository, so don't look for them.
Instead, put the last commit subject next to the revision to ease
identification of the commit.

launch_here.rb

index 6f9de4bf9983d48d871a6210ef00d8b7f6fb8bf8..e1e4a011d379cec299141f010ade4d39db6311a8 100755 (executable)
@@ -22,10 +22,12 @@ begin
         branch = $1.dup || "unknown"
         changed = git_out.match(/^# Change(.*)\n/)
         rev = "revision "
-        git_out = `git log -1 --pretty=format:"%h%n%b%n%ct"`.split("\n")
+        git_out = `git log -1 --pretty=format:"%h%n%s%n%ct"`.split("\n")
         rev << git_out.first
+        subject = git_out[1].strip
+        subject[77,subject.length] = "..." if subject.length > 80
+        rev << " [#{subject}]" unless subject.empty?
         $version_timestamp = git_out.last.to_i
-        rev << "(svn #{$1})" if git_out[1].match(/^git-svn-id: \S+@(\d+)/)
         rev << ", local changes" if changed
       else # older gits
         git_out = `git branch`