From: Junio C Hamano <hidden> Date: 2016-06-15 22:51:27
Sverre Rabbelier [off-list ref] writes:
quoted hunk
Now that the remote helper protocol uses the new done command in its
fast-import streams, export no longer needs to be the last command in
the stream.
Signed-off-by: Sverre Rabbelier <redacted>
---
...
@@ -762,7 +762,6 @@ static int push_refs_with_export(struct transport *transport,export_marks,import_marks,&revlist_args))die("Couldn't run fast-export");-data->no_disconnect_req=1;if(finish_command(&exporter))die("Error while running fast-export");push_update_refs_status(data,remote_refs);
I've looked at fa8c097 (Support remote helpers implementing smart
transports, 2009-12-09) which introduced this no_disconnect_req field,
73b49a7 (remote-helpers: add support for an export command, 2010-03-29)
which added push_refs_with_export() and made it set the field to 1, and
also have read Documentation/git-remote-helpers.txt, but fail to see the
connection between "this command no longer needs to be the last one" and
"we do not set no-disconnect-req to 1, so that we do not send an empty
line when we disconnect the helper".
Could you clarify the logic, perhaps by commenting a bit more where this
field is examined and code changes its behaviour in disconnect_helper()?
Heya,
On Thu, Jun 9, 2011 at 03:07, Junio C Hamano [off-list ref] wrote:
Could you clarify the logic, perhaps by commenting a bit more where this
field is examined and code changes its behaviour in disconnect_helper()?
Previously this bit had to be set, so that we didn't try to write the
trailing \n on a closed socket. Now, the socket is no longer closed,
so we can send the trailing \n again. Does that make sense?
--
Cheers,
Sverre Rabbelier
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:51:27
Sverre Rabbelier wrote:
On Thu, Jun 9, 2011 at 03:07, Junio C Hamano [off-list ref] wrote:
quoted
Could you clarify the logic, perhaps by commenting a bit more where this
field is examined and code changes its behaviour in disconnect_helper()?
Previously this bit had to be set, so that we didn't try to write the
trailing \n on a closed socket. Now, the socket is no longer closed,
so we can send the trailing \n again. Does that make sense?
Yes, but I'm still missing something. What does the trailing \n ever
have to be written?
"git log -Sdisconnect_helper -- transport-helper.c" doesn't give many
clues. I imagine it's a way to check whether the child is still alive
and to warn it not to be alarmed when the output end of its input pipe
closes.
Heya,
On Thu, Jun 9, 2011 at 09:51, Jonathan Nieder [off-list ref] wrote:
Yes, but I'm still missing something. What does the trailing \n ever
have to be written?
"git log -Sdisconnect_helper -- transport-helper.c" doesn't give many
clues. I imagine it's a way to check whether the child is still alive
and to warn it not to be alarmed when the output end of its input pipe
closes.
Yes, the trailing \n is to signal to the helper that the connection is
about to close, allowing it to do whatever cleanup necessarily. It's
kind of like the "done" command for fast-import.
--
Cheers,
Sverre Rabbelier