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

Re: [PATCH] git: extend --no-lazy-fetch to work across subprocesses

From
Jeff King <peff@peff.net>
Date
Feb 27, 2024, 07:49 UTC
Message-ID
<20240227074903.GD3263678@coredump.intra.peff.net>
In-Reply-To
<xmqqfrxexx15.fsf@gitster.g>
On Mon, Feb 26, 2024 at 10:04:54PM -0800, Junio C Hamano wrote:
> ----- >8 --------- >8 --------- >8 --------- >8 -----
> Subject: [PATCH v2 3/3] git: extend --no-lazy-fetch to work across subprocesses
> [...]

This looks pretty reasonable to me, and the lines you drew for #leftoverbits all seemed liked good spots.

The only thing I noticed in the patch was this (which I think is not even new in this round):

Show 12 quoted lines
> diff --git a/environment.c b/environment.c
> index 9e37bf58c0..afad78a3f8 100644
> --- a/environment.c
> +++ b/environment.c
> @@ -136,6 +136,7 @@ const char * const local_repo_env[] = {
>  	GRAFT_ENVIRONMENT,
>  	INDEX_ENVIRONMENT,
>  	NO_REPLACE_OBJECTS_ENVIRONMENT,
> +	NO_LAZY_FETCH_ENVIRONMENT,
>  	GIT_REPLACE_REF_BASE_ENVIRONMENT,
>  	GIT_PREFIX_ENVIRONMENT,
>  	GIT_SHALLOW_FILE_ENVIRONMENT,

This will clear the environment variable when we move between repositories. I can see an argument for it, and certainly that's how GIT_NO_REPLACE_OBJECTS works.

But I can also see an argument that this is not a property of the _repository_, but of the request. For example, if I run "git --no-lazy-fetch log" and we cross into a submodule to do a diff, should that submodule also avoid lazy-fetching? I'd think so, but I think your patch would restore the defaults when we "enter" the submodule repo.

There's some prior art there, I think, in how GIT_CEILING_DIRECTORIES works, or even something like "git --literal-pathspecs", neither of which appear in local_repo_env.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 14 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.