]> git.ipfire.org Git - thirdparty/git.git/commit - transport-helper.c
Connect fast-import to the remote-helper via pipe, adding 'bidi-import' capability
authorFlorian Achleitner <florian.achleitner.2.6.31@gmail.com>
Wed, 19 Sep 2012 15:21:19 +0000 (17:21 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 7 Oct 2012 21:10:16 +0000 (14:10 -0700)
commitbfc366d9315561166861bc97a395afc054c976c3
tree0ceb013859d4da4ad65dc52eb56da5a1f655c36d
parentdf7428eca46ec25df5ef14bc7e90120bdc267328
Connect fast-import to the remote-helper via pipe, adding 'bidi-import' capability

The fast-import commands 'cat-blob' and 'ls' can be used by
remote-helpers to retrieve information about blobs and trees that
already exist in fast-import's memory. This requires a channel from
fast-import to the remote-helper.

remote-helpers that use these features shall advertise the new
'bidi-import' capability to signal that they require the communication
channel.  When forking fast-import in transport-helper.c connect it to
a dup of the remote-helper's stdin-pipe. The additional file
descriptor is passed to fast-import via its command line
(--cat-blob-fd).  It follows that git and fast-import are connected to
the remote-helpers's stdin.

Because git can send multiple commands to the remote-helper on it's
stdin, it is required that helpers that advertise 'bidi-import' buffer
all input commands until the batch of 'import' commands is ended by a
newline before sending data to fast-import.  This is to prevent mixing
commands and fast-import responses on the helper's stdin.

Signed-off-by: Florian Achleitner <florian.achleitner.2.6.31@gmail.com>
Acked-by: David Michael Barr <b@rr-dav.id.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport-helper.c