git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-imap-send: simplify tunnel construction
@ 2014-08-13 17:30 Bernhard Reiter
  2014-08-17  7:30 ` Jeff King
  2014-08-18 17:00 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Bernhard Reiter @ 2014-08-13 17:30 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 129 bytes --]


Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
---
 imap-send.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)



[-- Attachment #2: 0001-git-imap-send-simplify-tunnel-construction.patch --]
[-- Type: text/x-patch, Size: 747 bytes --]

diff --git a/imap-send.c b/imap-send.c
index 524fbab..fb01a9c 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -961,17 +961,16 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc)
 	/* open connection to IMAP server */
 
 	if (srvc->tunnel) {
-		const char *argv[] = { srvc->tunnel, NULL };
 		struct child_process tunnel = {NULL};
 
 		imap_info("Starting tunnel '%s'... ", srvc->tunnel);
 
-		tunnel.argv = argv;
+		argv_array_push(&tunnel.args, srvc->tunnel);
 		tunnel.use_shell = 1;
 		tunnel.in = -1;
 		tunnel.out = -1;
 		if (start_command(&tunnel))
-			die("cannot start proxy %s", argv[0]);
+			die("cannot start proxy %s", srvc->tunnel);
 
 		imap->buf.sock.fd[0] = tunnel.out;
 		imap->buf.sock.fd[1] = tunnel.in;


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

* Re: [PATCH] git-imap-send: simplify tunnel construction
  2014-08-13 17:30 [PATCH] git-imap-send: simplify tunnel construction Bernhard Reiter
@ 2014-08-17  7:30 ` Jeff King
  2014-08-18 17:00 ` Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff King @ 2014-08-17  7:30 UTC (permalink / raw)
  To: Bernhard Reiter; +Cc: git

On Wed, Aug 13, 2014 at 07:30:43PM +0200, Bernhard Reiter wrote:

> Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
> ---
>  imap-send.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Thanks, this looks obviously correct and is a good direction.

-Peff

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

* Re: [PATCH] git-imap-send: simplify tunnel construction
  2014-08-13 17:30 [PATCH] git-imap-send: simplify tunnel construction Bernhard Reiter
  2014-08-17  7:30 ` Jeff King
@ 2014-08-18 17:00 ` Junio C Hamano
  2014-08-18 17:15   ` Bernhard Reiter
  1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2014-08-18 17:00 UTC (permalink / raw)
  To: Bernhard Reiter; +Cc: git

Bernhard Reiter <ockham@raz.or.at> writes:

> Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
> ---
>  imap-send.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Oy.  Where is the patch?

Please avoid multipart/mixed on this list.

Thanks.

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

* Re: [PATCH] git-imap-send: simplify tunnel construction
  2014-08-18 17:00 ` Junio C Hamano
@ 2014-08-18 17:15   ` Bernhard Reiter
  0 siblings, 0 replies; 4+ messages in thread
From: Bernhard Reiter @ 2014-08-18 17:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Am 2014-08-18 um 19:00 schrieb Junio C Hamano:
> Bernhard Reiter <ockham@raz.or.at> writes:
> 
>> Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
>> ---
>>  imap-send.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Oy.  Where is the patch?
> 
> Please avoid multipart/mixed on this list.
> 
> Thanks.

D'oh. Sorry about that. Strangely, that's what I'm getting from a
message created with git-imap-send. Maybe Thunderbird is messing it up
afterwards. Anyway:

diff --git a/imap-send.c b/imap-send.c
index 524fbab..fb01a9c 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -961,17 +961,16 @@ static struct imap_store *imap_open_store(struct
imap_server_conf *srvc)
 	/* open connection to IMAP server */

 	if (srvc->tunnel) {
-		const char *argv[] = { srvc->tunnel, NULL };
 		struct child_process tunnel = {NULL};

 		imap_info("Starting tunnel '%s'... ", srvc->tunnel);

-		tunnel.argv = argv;
+		argv_array_push(&tunnel.args, srvc->tunnel);
 		tunnel.use_shell = 1;
 		tunnel.in = -1;
 		tunnel.out = -1;
 		if (start_command(&tunnel))
-			die("cannot start proxy %s", argv[0]);
+			die("cannot start proxy %s", srvc->tunnel);

 		imap->buf.sock.fd[0] = tunnel.out;
 		imap->buf.sock.fd[1] = tunnel.in;

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

end of thread, other threads:[~2014-08-18 17:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-13 17:30 [PATCH] git-imap-send: simplify tunnel construction Bernhard Reiter
2014-08-17  7:30 ` Jeff King
2014-08-18 17:00 ` Junio C Hamano
2014-08-18 17:15   ` Bernhard Reiter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).