From 36b1426d7235344b4b33567de29b767ae2882276 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 27 Aug 2007 01:41:30 +0000 Subject: When running from a git repository, expose the current git revision --- bin/rbot | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bin/rbot') diff --git a/bin/rbot b/bin/rbot index c6d62daa..94634458 100755 --- a/bin/rbot +++ b/bin/rbot @@ -44,6 +44,17 @@ $opts = Hash.new if $version =~ /svn/ if defined?(SVN_DIR) and File.exists?(File.join(SVN_DIR, '.git')) $version.sub!('svn', 'git') + + git_out = `git status` + + git_out.match(/^# On branch (.*)\n/) + branch = $1 + changed = git_out.match(/^# Change(.*)\n/) + rev = " @ #{`git rev-parse HEAD`[0..6]}" + rev << ", local changes" if changed + + $version << "-#{branch}" unless branch.empty? + $version << rev else up = File.dirname(__FILE__) + "/.." rev = " (unknown revision)" -- cgit v1.2.3