# [PATCH] git-imap-send: simplify tunnel construction

4 messages from 2014-08-13 to 2014-08-18. Participants: Bernhard Reiter, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/37343

## Bernhard Reiter, 2014-08-13 17:30

Subject: [PATCH] git-imap-send: simplify tunnel construction
Message-ID: <53EBA0C3.2040805@raz.or.at>
URL: https://gitlist.dev/e/53EBA0C3.2040805%40raz.or.at

```

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




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;


```

## Jeff King, 2014-08-17 07:30

Subject: Re: [PATCH] git-imap-send: simplify tunnel construction
Message-ID: <20140817073058.GF23808@peff.net>
URL: https://gitlist.dev/e/20140817073058.GF23808%40peff.net
In-Reply-To: <53EBA0C3.2040805@raz.or.at>

```
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

```

## Junio C Hamano, 2014-08-18 17:00

Subject: Re: [PATCH] git-imap-send: simplify tunnel construction
Message-ID: <xmqq1tsdybq8.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqq1tsdybq8.fsf%40gitster.dls.corp.google.com
In-Reply-To: <53EBA0C3.2040805@raz.or.at>

```
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.

```

## Bernhard Reiter, 2014-08-18 17:15

Subject: Re: [PATCH] git-imap-send: simplify tunnel construction
Message-ID: <53F234A5.7010704@raz.or.at>
URL: https://gitlist.dev/e/53F234A5.7010704%40raz.or.at
In-Reply-To: <xmqq1tsdybq8.fsf@gitster.dls.corp.google.com>

```
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;

```
