Git development
 help / color / mirror / Atom feed
* [PATCH] builtin/send-pack.c: Respect http.signingkey
@ 2015-07-21 22:06 Dave Borowitz
  2015-07-21 22:24 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Borowitz @ 2015-07-21 22:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Dave Borowitz

From: Junio C Hamano <gitster@pobox.com>

Prior to this patch, when git-send-pack was exec'ed, as is done by
git-remote-http, it did not reread the config, so it did not respect
the configured value of http.signingkey. Thus it was impossible to
specify a signing key over HTTP, other than the default key in the
keyring having a User ID matching the "Name <email>" format.

This patch at least partially fixes the problem by reading in the GPG
config from within send-pack. It does not address the related problem
of plumbing a value for this configuration option using
`git -c http.signingkey push ...`.

Signed-off-by: Dave Borowitz <dborowitz@google.com>
---
 builtin/send-pack.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index b961e5a..23b2962 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -11,6 +11,7 @@
 #include "transport.h"
 #include "version.h"
 #include "sha1-array.h"
+#include "gpg-interface.h"
 
 static const char send_pack_usage[] =
 "git send-pack [--all | --mirror] [--dry-run] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [--atomic] [<host>:]<directory> [<ref>...]\n"
@@ -113,6 +114,8 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
 	int from_stdin = 0;
 	struct push_cas_option cas = {0};
 
+	git_config(git_gpg_config, NULL);
+
 	argv++;
 	for (i = 1; i < argc; i++, argv++) {
 		const char *arg = *argv;
-- 
2.4.3.573.g4eafbef

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] builtin/send-pack.c: Respect http.signingkey
  2015-07-21 22:06 [PATCH] builtin/send-pack.c: Respect http.signingkey Dave Borowitz
@ 2015-07-21 22:24 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2015-07-21 22:24 UTC (permalink / raw)
  To: Dave Borowitz; +Cc: git

Dave Borowitz <dborowitz@google.com> writes:

> From: Junio C Hamano <gitster@pobox.com>
>
> Prior to this patch, when git-send-pack was exec'ed, as is done by
> git-remote-http, it did not reread the config, so it did not respect
> the configured value of http.signingkey. Thus it was impossible to
> specify a signing key over HTTP, other than the default key in the
> keyring having a User ID matching the "Name <email>" format.
>
> This patch at least partially fixes the problem by reading in the GPG
> config from within send-pack. It does not address the related problem
> of plumbing a value for this configuration option using
> `git -c http.signingkey push ...`.

I am hoping that "git -c user.signingkey=frotz push ..." would solve
that problem, but I probably am being too optimistic ;-)

Thanks.

>
> Signed-off-by: Dave Borowitz <dborowitz@google.com>
> ---
>  builtin/send-pack.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/builtin/send-pack.c b/builtin/send-pack.c
> index b961e5a..23b2962 100644
> --- a/builtin/send-pack.c
> +++ b/builtin/send-pack.c
> @@ -11,6 +11,7 @@
>  #include "transport.h"
>  #include "version.h"
>  #include "sha1-array.h"
> +#include "gpg-interface.h"
>  
>  static const char send_pack_usage[] =
>  "git send-pack [--all | --mirror] [--dry-run] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [--atomic] [<host>:]<directory> [<ref>...]\n"
> @@ -113,6 +114,8 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
>  	int from_stdin = 0;
>  	struct push_cas_option cas = {0};
>  
> +	git_config(git_gpg_config, NULL);
> +
>  	argv++;
>  	for (i = 1; i < argc; i++, argv++) {
>  		const char *arg = *argv;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-21 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-21 22:06 [PATCH] builtin/send-pack.c: Respect http.signingkey Dave Borowitz
2015-07-21 22:24 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox