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

[PATCH 2/2] send-pack: only send a thin pack if the server supports it

From
Carlos Martín Nieto <cmn@elego.de>
Date
Nov 6, 2013, 15:04 UTC
Message-ID
<1383750263-32495-3-git-send-email-cmn@elego.de>
In-Reply-To
<1383750263-32495-1-git-send-email-cmn@elego.de>

In combination a the previous patch making receive-pack advertise the thin-pack capability, this allows git to push to a server in a constrained environment which is not able to fix thin packs while taking advantage of the feature for servers which can.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
---
 send-pack.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/send-pack.c b/send-pack.c
index 7d172ef..7b88ac8 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -205,6 +205,8 @@ int send_pack(struct send_pack_args *args,
 		quiet_supported = 1;
 	if (server_supports("agent"))
 		agent_supported = 1;
+	if (!server_supports("thin-pack"))
+		args->use_thin_pack = 0;
 
 	if (!remote_refs) {
 		fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
-- 
1.8.4.652.g0d6e0ce
Previous: Carlos Martín NietoNext: Junio C Hamano
Message 3 of 10 in “thin-pack capability for send-pack/receive-pack”
  1. 0/2 thin-pack capability for send-pack/receive-packCarlos Martín Nieto, Nov 6, 2013
  2. 1/2 receive-pack: advertise thin-packCarlos Martín Nieto, Nov 6, 2013
  3. 2/2 send-pack: only send a thin pack if the server supports itCarlos Martín Nieto, Nov 6, 2013
  4. Junio C HamanoNov 6, 2013
  5. Carlos Martín NietoNov 6, 2013
  6. Junio C HamanoNov 6, 2013
  7. Jeff KingNov 6, 2013
  8. Shawn PearceNov 6, 2013
  9. Shawn PearceNov 6, 2013
  10. Carlos Martín NietoNov 23, 2013

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.