mklog: Fallback to env author name and addr
diff mbox

Message ID 1428521808-30487-1-git-send-email-rep.dot.nop@gmail.com
State New
Headers show

Commit Message

Bernhard Reutner-Fischer April 8, 2015, 7:36 p.m. UTC
contrib/ChangeLog:

2015-04-08  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* mklog ($name, $addr): Fallback to env author settings.
---
 contrib/mklog | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Diego Novillo April 8, 2015, 7:45 p.m. UTC | #1
On Wed, Apr 8, 2015 at 3:36 PM, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> contrib/ChangeLog:
>
> 2015-04-08  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
>
>         * mklog ($name, $addr): Fallback to env author settings.

This looks fine, but note that I no longer have approval rights for
patches. Code in contrib/ has looser requirements, and the patch is
clearly harmless. I would just add documentation on the GIT_AUTHOR_*
environment variables at the top of the script.


Diego.
Bernhard Reutner-Fischer April 8, 2015, 8:04 p.m. UTC | #2
On 8 April 2015 at 21:45, Diego Novillo <dnovillo@google.com> wrote:
> On Wed, Apr 8, 2015 at 3:36 PM, Bernhard Reutner-Fischer
> <rep.dot.nop@gmail.com> wrote:
>> contrib/ChangeLog:
>>
>> 2015-04-08  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
>>
>>         * mklog ($name, $addr): Fallback to env author settings.
>
> This looks fine, but note that I no longer have approval rights for

yuck. I remember now, what a pity.

> patches. Code in contrib/ has looser requirements, and the patch is
> clearly harmless. I would just add documentation on the GIT_AUTHOR_*
> environment variables at the top of the script.

I'll document them, thanks!

Patch
diff mbox

diff --git a/contrib/mklog b/contrib/mklog
index f7974a7..4cad351 100755
--- a/contrib/mklog
+++ b/contrib/mklog
@@ -53,9 +53,9 @@  if (-f "$conf") {
 	    . $dot_mklog_format_msg;
     }
 } else {
-    $name = `git config user.name`;
+    $name = `git config user.name` || $ENV{GIT_AUTHOR_NAME};
     chomp($name);
-    $addr = `git config user.email`;
+    $addr = `git config user.email` || $ENV{GIT_AUTHOR_EMAIL};
     chomp($addr);
 
     if (!($name && $addr)) {