Re: git-remote-fd problem
- From
- Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
- Date
- Sep 10, 2014, 14:47 UTC
- Message-ID
- <20140910144756.GA4267@LK-Perkele-VII>
- In-Reply-To
- <CAOP4-939uAP2Tgofz01F40_Eb0F8GxBsU49HxNvAiyBCW6H08w@mail.gmail.com>
On Wed, Sep 10, 2014 at 03:29:00PM +0200, Jiri Sevcik wrote:
Show 13 quoted lines
> Hi! > I have problem with using git-remote-fd function. I create two local > pipes for communication for locally running process git pull. Then I > start git-upload-pack on remote side (this process is started in > different part of my code and it works correctly). Communication runs > successfully and when remote side finish, I want to close local pipes > to finish local process. I call close function to all of these pipes, > but unfortunatelly local process doesnt finish (in this moment > transfered data aresaved in /.git/object/pack folder in .pack files) > and hanging on. But if I kill child of this local process, downloaded > files are unpacked and files are created sucessfully. I think this way > is not so correct. Can someone help me and tell me what am I doing > wrong? Thank You. Code is in an attachement (its part of big system).
The remote-fd expects the transport to pass half-closes. So you can't close all at once.
Let there be pipes W and R and transport connection C.
- W-read should be closed after being passed to remote-fd. - R-write should be closed after being passed to remote-fd. - Upon receiving "no more data" from C, close W-write. - Upon receiving EOF from R-read, close it and signal "no more data" to C.
If you have server end, the same applies, but with remote-fd replaced by upload-pack/upload-archive/receive-pack.
-Ilari