# [PATCH] log: make "show --show-signature" use gpg.program setting

3 messages from 2013-03-25 to 2013-03-27. Participants: Hans Brigman, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/33281

## Hans Brigman, 2013-03-25 18:03

Subject: [PATCH] log: make "show --show-signature" use gpg.program setting
Message-ID: <8C726954D36902459248B0627BF2E66F45D7029930@AUSP01VMBX10.collaborationhost.net>
URL: https://gitlist.dev/e/8C726954D36902459248B0627BF2E66F45D7029930%40AUSP01VMBX10.collaborationhost.net

```
"show --show-signature" doesn't currently use the gpg.program setting.  Commit signing, tag signing, and tag verification currently use this setting properly, so the logic has been added to handle it here as well.

Signed-off-by: Hans Brigman <hbrigman@openspan.com>
---
 builtin/log.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin/log.c b/builtin/log.c
index 8f0b2e8..a6c5576 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -23,6 +23,7 @@
 #include "streaming.h"
 #include "version.h"
 #include "mailmap.h"
+#include "gpg-interface.h"
 
 /* Set a default date-time format for git log ("log.date" config variable) */
 static const char *default_date_mode = NULL;
@@ -364,7 +365,8 @@ static int git_log_config(const char *var, const char *value, void *cb)
 		use_mailmap_config = git_config_bool(var, value);
 		return 0;
 	}
-
+	if (!prefixcmp(var, "gpg."))
+		return git_gpg_config(var, value, NULL); 
 	if (grep_config(var, value, cb) < 0)
 		return -1;
 	return git_diff_ui_config(var, value, cb);
-- 
1.7.11.msysgit.0



From 5e0b3de93e90750ea8d3f5c897861886647672b4 Mon Sep 17 00:00:00 2001
From: Hans Brigman <datyedyeguy@gmail.com>
Date: Fri, 22 Mar 2013 16:41:06 -0400
Subject: [PATCH] log: make "show --show-signature" use gpg.program setting

"show --show-signature" doesn't currently use the gpg.program setting.  Commit signing, tag signing, and tag verification currently use this setting properly, so the logic has been added to handle it here as well.

Signed-off-by: Hans Brigman <datyedyeguy@gmail.com>
---
 builtin/log.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin/log.c b/builtin/log.c
index 8f0b2e8..a6c5576 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -23,6 +23,7 @@
 #include "streaming.h"
 #include "version.h"
 #include "mailmap.h"
+#include "gpg-interface.h"
 
 /* Set a default date-time format for git log ("log.date" config variable) */
 static const char *default_date_mode = NULL;
@@ -364,7 +365,8 @@ static int git_log_config(const char *var, const char *value, void *cb)
 		use_mailmap_config = git_config_bool(var, value);
 		return 0;
 	}
-
+	if (!prefixcmp(var, "gpg."))
+		return git_gpg_config(var, value, NULL); 
 	if (grep_config(var, value, cb) < 0)
 		return -1;
 	return git_diff_ui_config(var, value, cb);
-- 
1.7.11.msysgit.0


```

## Jeff King, 2013-03-25 21:34

Subject: Re: [PATCH] log: make "show --show-signature" use gpg.program setting
Message-ID: <20130325213453.GB19303@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20130325213453.GB19303%40sigill.intra.peff.net
In-Reply-To: <8C726954D36902459248B0627BF2E66F45D7029930@AUSP01VMBX10.collaborationhost.net>

```
On Mon, Mar 25, 2013 at 01:03:52PM -0500, Hans Brigman wrote:

> "show --show-signature" doesn't currently use the gpg.program setting.  Commit signing, tag signing, and tag verification currently use this setting properly, so the logic has been added to handle it here as well.

Please wrap your commit messages at something reasonable (70 is probably
as high as you want to go, given that log output is often shown
indented).

> @@ -364,7 +365,8 @@ static int git_log_config(const char *var, const char *value, void *cb)
>  		use_mailmap_config = git_config_bool(var, value);
>  		return 0;
>  	}
> -
> +	if (!prefixcmp(var, "gpg."))
> +		return git_gpg_config(var, value, NULL); 
>  	if (grep_config(var, value, cb) < 0)
>  		return -1;

The gpg config can also be other places than "gpg.*". Right now it is
just user.signingkey, which log would not care about, but it feels like
we are depending an unnecessary detail here. We also don't know whether
it would care about the callback data. Is there a reason not to do:

  if (git_gpg_config(var, value, cb) < 0)
          return -1;

just like the grep_config call below?

-Peff

```

## Junio C Hamano, 2013-03-27 15:59

Subject: Re: [PATCH] log: make "show --show-signature" use gpg.program setting
Message-ID: <7vzjxoomuk.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzjxoomuk.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20130325213453.GB19303@sigill.intra.peff.net>

```
Jeff King <peff@peff.net> writes:

> On Mon, Mar 25, 2013 at 01:03:52PM -0500, Hans Brigman wrote:
>
>> "show --show-signature" doesn't currently use the gpg.program setting.  Commit signing, tag signing, and tag verification currently use this setting properly, so the logic has been added to handle it here as well.
>
> Please wrap your commit messages at something reasonable (70 is probably
> as high as you want to go, given that log output is often shown
> indented).

Thanks for pointing out Documentation/SubmittingPatches.

Also please do not send multipart/mixed (or alternative).  Send
patches in text/plain.

>> @@ -364,7 +365,8 @@ static int git_log_config(const char *var, const char *value, void *cb)
>>  		use_mailmap_config = git_config_bool(var, value);
>>  		return 0;
>>  	}
>> -
>> +	if (!prefixcmp(var, "gpg."))
>> +		return git_gpg_config(var, value, NULL); 
>>  	if (grep_config(var, value, cb) < 0)
>>  		return -1;
>
> The gpg config can also be other places than "gpg.*". Right now it is
> just user.signingkey, which log would not care about, but it feels like
> we are depending an unnecessary detail here. We also don't know whether
> it would care about the callback data. Is there a reason not to do:
>
>   if (git_gpg_config(var, value, cb) < 0)
>           return -1;
>
> just like the grep_config call below?
>
> -Peff

```
