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

[PATCH 3/3] fetch-pack: print server version at the top in -v -v

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Jun 20, 2019, 11:59 UTC
Message-ID
<20190620115951.13629-3-pclouds@gmail.com>
In-Reply-To
<20190620115951.13629-1-pclouds@gmail.com>

Before the previous patch, the server version is printed after all the "Server supports" lines. The previous one puts the version in the middle of "Server supports" group.

Instead of moving it to the bottom, I move it to the top. Version may stand out more at the top as we will have even more debug out after capabilities.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 fetch-pack.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/fetch-pack.c b/fetch-pack.c
index de935f8776..445a261f14 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -902,6 +902,13 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
 	sort_ref_list(&ref, ref_compare_name);
 	QSORT(sought, nr_sought, cmp_ref_by_name);
 
+	if ((agent_feature = server_feature_value("agent", &agent_len))) {
+		agent_supported = 1;
+		if (agent_len)
+			print_verbose(args, _("Server version is %.*s"),
+				      agent_len, agent_feature);
+	}
+
 	if (server_supports("shallow"))
 		print_verbose(args, _("Server supports %s"), "shallow");
 	else if (args->depth > 0 || is_repository_shallow(the_repository))
@@ -961,12 +968,6 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
 		warning("filtering not recognized by server, ignoring");
 	}
 
-	if ((agent_feature = server_feature_value("agent", &agent_len))) {
-		agent_supported = 1;
-		if (agent_len)
-			print_verbose(args, _("Server version is %.*s"),
-				      agent_len, agent_feature);
-	}
 	if (server_supports("deepen-since")) {
 		print_verbose(args, _("Server supports %s"), "deepen-since");
 		deepen_since_ok = 1;
-- 
2.22.0.rc0.322.g2b0371e29a
Previous: Nguyễn Thái Ngọc Duy
Message 3 of 3 in “fetch-pack: move capability names out of i18n strings”
  1. 1/3 fetch-pack: move capability names out of i18n stringsNguyễn Thái Ngọc Duy, Jun 20, 2019
  2. 2/3 fetch-pack: print all relevant supported capabilities with -v -vNguyễn Thái Ngọc Duy, Jun 20, 2019
  3. 3/3 fetch-pack: print server version at the top in -v -vNguyễn Thái Ngọc Duy, Jun 20, 2019

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.