git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] transport-helper: ask the helper to set progress and verbosity options after asking for its capabilities

From
Mike Hommey <mh@glandium.org>
Date
Feb 13, 2015, 05:24 UTC
Message-ID
<1423805086-807-1-git-send-email-mh@glandium.org>
In-Reply-To
<xmqqlhk2ri1j.fsf@gitster.dls.corp.google.com>

Currently, a remote helper is only told about the progress and verbosity options for the 'fetch' and 'push' commands. This means a remote helper that implements 'import' and 'export' can never know the user requested progress or verbosity (or lack thereof) through the command line.

Telling the remote helper about those options after asking for its capabilities ensures it can act accordingly for all commands.

Signed-off-by: Mike Hommey <mh@glandium.org>
---
 transport-helper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 0224687..23a741c 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -98,6 +98,8 @@ static void do_take_over(struct transport *transport)
 	free(data);
 }
 
+static void standard_options(struct transport *t);
+
 static struct child_process *get_helper(struct transport *transport)
 {
 	struct helper_data *data = transport->data;
@@ -212,6 +214,7 @@ static struct child_process *get_helper(struct transport *transport)
 	strbuf_release(&buf);
 	if (debug)
 		fprintf(stderr, "Debug: Capabilities complete.\n");
+	standard_options(transport);
 	return data->helper;
 }
 
@@ -339,7 +342,6 @@ static int fetch_with_fetch(struct transport *transport,
 	int i;
 	struct strbuf buf = STRBUF_INIT;
 
-	standard_options(transport);
 	if (data->check_connectivity &&
 	    data->transport_options.check_self_contained_and_connected)
 		set_helper_option(transport, "check-connectivity", "true");
@@ -824,7 +826,6 @@ static int push_refs_with_push(struct transport *transport,
 		return 0;
 	}
 
-	standard_options(transport);
 	for_each_string_list_item(cas_option, &cas_options)
 		set_helper_option(transport, "cas", cas_option->string);
 
-- 
2.3.0.3.g5a196f5
Previous: Junio C HamanoNext: Mike Hommey
Message 7 of 11 in “transport-helper: emit progress and verbosity options after asking for capabilities”
  1. 1/3 transport-helper: emit progress and verbosity options after asking for capabilitiesMike Hommey, Feb 12, 2015
  2. 2/3 transport-helper: emit check-connectivity, cloning, and update-shallow options for importMike Hommey, Feb 12, 2015
  3. 3/3 transport-helper: fix typo in error message when --signed is not supportedMike Hommey, Feb 12, 2015
  4. Mike HommeyFeb 12, 2015
  5. Junio C HamanoFeb 12, 2015
  6. Junio C HamanoFeb 12, 2015
  7. 1/2 transport-helper: ask the helper to set progress and verbosity options after asking for its capabilitiesMike Hommey, Feb 13, 2015
  8. 2/2 transport-helper: ask the helper to set the same options for import as for fetchMike Hommey, Feb 13, 2015
  9. Junio C HamanoFeb 13, 2015
  10. Mike HommeyFeb 13, 2015
  11. Junio C HamanoFeb 14, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.