# [PATCH] transport-helper: call git fast-import properly

3 messages from 2012-10-17 to 2012-10-18. Participants: Felipe Contreras, Sverre Rabbelier.
Thread: https://gitlist.dev/t/31846

## Felipe Contreras, 2012-10-17 08:27

Subject: [PATCH] transport-helper: call git fast-import properly
Message-ID: <1350462440-427-1-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1350462440-427-1-git-send-email-felipe.contreras%40gmail.com

```
The marks options are being ignored right now.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 transport-helper.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/transport-helper.c b/transport-helper.c
index cfe0988..29bde0a 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -375,12 +375,19 @@ static int fetch_with_fetch(struct transport *transport,
 
 static int get_importer(struct transport *transport, struct child_process *fastimport)
 {
+	struct helper_data *data = transport->data;
 	struct child_process *helper = get_helper(transport);
+	int argc = 0;
+
 	memset(fastimport, 0, sizeof(*fastimport));
 	fastimport->in = helper->out;
 	fastimport->argv = xcalloc(5, sizeof(*fastimport->argv));
-	fastimport->argv[0] = "fast-import";
-	fastimport->argv[1] = "--quiet";
+	fastimport->argv[argc++] = "fast-import";
+	fastimport->argv[argc++] = "--quiet";
+	if (data->export_marks)
+		fastimport->argv[argc++] = data->export_marks;
+	if (data->import_marks)
+		fastimport->argv[argc++] = data->import_marks;
 
 	fastimport->git_cmd = 1;
 	return start_command(fastimport);
-- 
1.8.0.rc2.5.gccf4c94

```

## Sverre Rabbelier, 2012-10-18 05:13

Subject: Re: [PATCH] transport-helper: call git fast-import properly
Message-ID: <CAGdFq_jNs_CNN8PGbbgvJbmNTSSN9TaEDxCSyDEpScZL4zyiwg@mail.gmail.com>
URL: https://gitlist.dev/e/CAGdFq_jNs_CNN8PGbbgvJbmNTSSN9TaEDxCSyDEpScZL4zyiwg%40mail.gmail.com
In-Reply-To: <1350462440-427-1-git-send-email-felipe.contreras@gmail.com>

```
On Wed, Oct 17, 2012 at 1:27 AM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> The marks options are being ignored right now.

It seems unlikely to me that this never worked, surely no reviewer
would accept a patch that doesn't actually implement the feature?
What's the history here?

-- 
Cheers,

Sverre Rabbelier

```

## Felipe Contreras, 2012-10-18 07:39

Subject: Re: [PATCH] transport-helper: call git fast-import properly
Message-ID: <CAMP44s3FsdF7944TkO3CVCV9d80TTocE5zXyE8sh1bXL0eMu5Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s3FsdF7944TkO3CVCV9d80TTocE5zXyE8sh1bXL0eMu5Q%40mail.gmail.com
In-Reply-To: <CAGdFq_jNs_CNN8PGbbgvJbmNTSSN9TaEDxCSyDEpScZL4zyiwg@mail.gmail.com>

```
On Thu, Oct 18, 2012 at 7:13 AM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> On Wed, Oct 17, 2012 at 1:27 AM, Felipe Contreras
> <felipe.contreras@gmail.com> wrote:
>> The marks options are being ignored right now.
>
> It seems unlikely to me that this never worked, surely no reviewer
> would accept a patch that doesn't actually implement the feature?
> What's the history here?

Now I see, the {import,export}-marks options are only meant for
fast-export, for fast-import one should use the 'feature' commands. It
took me a while because the git_remote_helper code for python is very
confusing: it uses testgit.marks for the marks that git generates, and
git.marks for the marks that testgit generates.

It's not very convenient for remote-helpers that can export single
branches as opposed to the whole repo:

http://github.com/felipec/git/commit/0961fdf8231a4ac057eec8a306a708e66f7b6ae9

But it works, so this patch is not needed.

-- 
Felipe Contreras

```
