This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 1/2] teach mklog to get name / email from git config when available
- From: tsaunders at mozilla dot com
- To: gcc-patches at gcc dot gnu dot org
- Cc: dnovillo at google dot com, Trevor Saunders <tbsaunde at mozilla dot com>
- Date: Mon, 28 Apr 2014 22:11:07 -0400
- Subject: [PATCH 1/2] teach mklog to get name / email from git config when available
- Authentication-results: sourceware.org; auth=none
- References: <1398737468-6981-1-git-send-email-tsaunders at mozilla dot com>
From: Trevor Saunders <tbsaunde@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 <tbsaunde@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