From: Linus Arver <linusa@google.com>
To: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH] git: --no-lazy-fetch option
Date: Thu, 15 Feb 2024 12:59:09 -0800 [thread overview]
Message-ID: <owly4je9a1gi.fsf@fine.c.googlers.com> (raw)
In-Reply-To: <20240215053056.GD2821179@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Thu, Feb 08, 2024 at 03:17:31PM -0800, Junio C Hamano wrote:
>
>> 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.
>
> That seems like a good feature, but...
>
>> @@ -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);
>
> This will only help builtin commands, and even then only the top-level
> one. If I run "git --no-lazy-fetch foo" and "foo" is a script or an
> alias, I'd expect it to still take effect. Ditto for sub-commands kicked
> off by a builtin (say, a "rev-list" connectivity check caused by a
> fetch).
>
> So this probably needs to be modeled after --no-replace-objects, etc,
> where we set an environment variable that makes it to child processes.
Thanks for the helpful explanation, very much appreciated.
prev parent reply other threads:[~2024-02-15 20:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=owly4je9a1gi.fsf@fine.c.googlers.com \
--to=linusa@google.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).