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

Re: [PATCH] git: --no-lazy-fetch option

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 15, 2024, 17:04 UTC
Message-ID
<xmqqv86pslos.fsf@gitster.g>
In-Reply-To
<20240215053056.GD2821179@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 27 quoted lines
> 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.

Yuck, I was hoping that we can get away with the tiny change only for builtins,but you're right.

Previous: Jeff KingNext: Junio C Hamano
Message 6 of 20 in “git: --no-lazy-fetch option”
  1. git: --no-lazy-fetch optionJunio C Hamano, Feb 8, 2024
  2. Linus ArverFeb 13, 2024
  3. Linus ArverFeb 13, 2024
  4. Junio C HamanoFeb 13, 2024
  5. Jeff KingFeb 15, 2024
  6. Junio C HamanoFeb 15, 2024
  7. Junio C HamanoFeb 16, 2024
  8. git: extend --no-lazy-fetch to work across subprocessesJunio C Hamano, Feb 16, 2024
  9. Linus ArverFeb 16, 2024
  10. Junio C HamanoFeb 16, 2024
  11. Linus ArverFeb 16, 2024
  12. Jeff KingFeb 17, 2024
  13. Junio C HamanoFeb 27, 2024
  14. Jeff KingFeb 27, 2024
  15. Junio C HamanoFeb 27, 2024
  16. Jeff KingMar 7, 2024
  17. Junio C HamanoMar 7, 2024
  18. Jeff KingFeb 17, 2024
  19. Linus ArverMar 9, 2024
  20. Linus ArverFeb 15, 2024

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.