From: Trevor Saunders <tbsau...@mozilla.com>

Hi,

 finger gives the wrong data on my machines, and while I could fix it it seems
nicer to use what's configured for the git repo we're in if any, that way you
can use different defaults from the rest of the machine.

Trev

contrib/ChangeLog:

2014-04-28  Trevor Saunders  <tbsau...@mozilla.com>

        * mklog: if in a git checkout try to get name and email from git.
---
 contrib/mklog | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/contrib/mklog b/contrib/mklog
index fb489b0..5f5d98e 100755
--- a/contrib/mklog
+++ b/contrib/mklog
@@ -38,6 +38,20 @@ $gcc_root = $0;
 $gcc_root =~ s/[^\\\/]+$/../;
 chdir $gcc_root;
 
+# if this is a git tree then take name and email from the git configuration
+if (-d .git) {
+  $gitname = `git config user.name`;
+  chomp($gitname);
+  if ($gitname) {
+         $name = $gitname;
+  }
+
+  $gitaddr = `git config user.email`;
+  chomp($gitaddr);
+  if ($gitaddr) {
+         $addr = $gitaddr;
+  }
+}
 
 #-----------------------------------------------------------------------------
 # Program starts here. You should not need to edit anything below this
-- 
2.0.0.rc0

Reply via email to