git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git: --no-lazy-fetch option
@ 2024-02-08 23:17 Junio C Hamano
  2024-02-13 20:23 ` Linus Arver
  2024-02-15  5:30 ` Jeff King
  0 siblings, 2 replies; 20+ messages in thread
From: Junio C Hamano @ 2024-02-08 23:17 UTC (permalink / raw)
  To: git; +Cc: Christian Couder

Sometimes, especially during tests of low level machinery, it is
handy to have a way to disable lazy fetching of objects.  This
allows us to say, for example, "git cat-file -e <object-name>", to
see if the object is locally available.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 git.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/git.c b/git.c
index 7068a184b0..fd9b0e6a9e 100644
--- a/git.c
+++ b/git.c
@@ -4,6 +4,7 @@
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "help.h"
+#include "object-file.h"
 #include "pager.h"
 #include "read-cache-ll.h"
 #include "run-command.h"
@@ -186,6 +187,8 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
 			use_pager = 0;
 			if (envchanged)
 				*envchanged = 1;
+		} else if (!strcmp(cmd, "--no-lazy-fetch")) {
+			fetch_if_missing = 0;
 		} else if (!strcmp(cmd, "--no-replace-objects")) {
 			disable_replace_refs();
 			setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
-- 
2.43.0-581-g5216f8f5c4


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-03-09  1:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-08 23:17 [PATCH] git: --no-lazy-fetch option Junio C Hamano
2024-02-13 20:23 ` Linus Arver
2024-02-13 20:37   ` Linus Arver
2024-02-13 20:49     ` Junio C Hamano
2024-02-15  5:30 ` Jeff King
2024-02-15 17:04   ` Junio C Hamano
2024-02-16 17:22     ` Junio C Hamano
2024-02-16 21:09       ` [PATCH] git: extend --no-lazy-fetch to work across subprocesses Junio C Hamano
2024-02-16 22:30         ` Linus Arver
2024-02-16 23:01           ` Junio C Hamano
2024-02-16 23:12             ` Linus Arver
2024-02-17  5:40         ` Jeff King
2024-02-27  6:04           ` Junio C Hamano
2024-02-27  7:49             ` Jeff King
2024-02-27 16:48               ` Junio C Hamano
2024-03-07  9:56                 ` Jeff King
2024-03-07 20:33                   ` Junio C Hamano
2024-02-17  5:29       ` [PATCH] git: --no-lazy-fetch option Jeff King
2024-03-09  1:57         ` Linus Arver
2024-02-15 20:59   ` Linus Arver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).