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

[PATCH 1/2] fetch-pack: remove fetch_if_missing=0

From
HGHariom Verma via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 20, 2020, 19:54 UTC
Message-ID
<eb0cbeeeed080596c130f657186894999ae6121b.1587412477.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.606.git.1587412477.gitgitgadget@gmail.com>
From: Hariom Verma <hariom18599@gmail.com>

Commit 6462d5e ("fetch: remove fetch_if_missing=0", 2019-11-08) strove to remove the need for fetch_if_missing=0 from the fetching mechanism, so it is plausible to attempt removing fetch_if_missing=0 from fetch-pack as well.

Signed-off-by: Hariom Verma <hariom18599@gmail.com>
---
 builtin/fetch-pack.c | 2 --
 fetch-pack.c         | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index dc1485c8aa1..38a45512918 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -57,8 +57,6 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
 	struct packet_reader reader;
 	enum protocol_version version;
 
-	fetch_if_missing = 0;
-
 	packet_trace_identity("fetch-pack");
 
 	memset(&args, 0, sizeof(args));
diff --git a/fetch-pack.c b/fetch-pack.c
index 1734a573b01..1ca643f6491 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -1649,7 +1649,7 @@ static void update_shallow(struct fetch_pack_args *args,
 		struct oid_array extra = OID_ARRAY_INIT;
 		struct object_id *oid = si->shallow->oid;
 		for (i = 0; i < si->shallow->nr; i++)
-			if (has_object_file(&oid[i]))
+			if (has_object_file_with_flags(&oid[i], OBJECT_INFO_SKIP_FETCH_OBJECT))
 				oid_array_append(&extra, &oid[i]);
 		if (extra.nr) {
 			setup_alternate_shallow(&shallow_lock,
-- 
gitgitgadget
Previous: Hariom Verma via GitGitGadgetNext: Christian Couder
Message 2 of 19 in “[WIP] removed fetch_if_missing global”
  1. 0/2 [WIP] removed fetch_if_missing globalHariom Verma via GitGitGadget, Apr 20, 2020
  2. 1/2 fetch-pack: remove fetch_if_missing=0Hariom Verma via GitGitGadget, Apr 20, 2020
  3. Christian CouderMay 7, 2020
  4. Junio C HamanoMay 7, 2020
  5. Hariom vermaMay 9, 2020
  6. Hariom vermaMay 9, 2020
  7. Jonathan TanMay 7, 2020
  8. Hariom vermaMay 9, 2020
  9. Kousik SanagavarapuFeb 20, 2023
  10. Jonathan TanFeb 22, 2023
  11. Kousik SanagavarapuFeb 22, 2023
  12. 2/2 index-pack: remove fetch_if_missing=0Hariom Verma via GitGitGadget, Apr 20, 2020
  13. Christian CouderMay 7, 2020
  14. Hariom vermaMay 9, 2020
  15. Kousik SanagavarapuFeb 17, 2023
  16. Christian CouderFeb 18, 2023
  17. Kousik SanagavarapuFeb 19, 2023
  18. Christian CouderFeb 19, 2023
  19. Hariom vermaFeb 19, 2023

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.