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

Re: [PATCH v2] submodules: fix of regression on fetching of non-init subsub-repo

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 7, 2020, 19:43 UTC
Message-ID
<xmqqpn3l9zce.fsf@gitster.c.googlers.com>
In-Reply-To
<613FAD04-0D5A-4DE0-8FE8-0C5C5619B7BC@gmail.com>
Philippe Blain <levraiphilippeblain@gmail.com> writes:
Show 13 quoted lines
> Maybe a personal preference, but I would have gone for something a
> little simpler, like the following:
>
> diff --git a/submodule.c b/submodule.c
> index b3bb59f066..4200865174 100644
> --- a/submodule.c
> +++ b/submodule.c
> @@ -1486,7 +1486,7 @@ static int get_next_submodule(struct child_process *cp,
>                          * the submodule is not initialized
>                          */
>                         if (S_ISGITLINK(ce->ce_mode) &&
> -                           !is_empty_dir(ce->name)) {
> +                           !is_empty_dir(repo_worktree_path(spf->r, "%s", ce->name))) {
But then you leak the return value from repo_worktree_path(), no?
Show 12 quoted lines
>> +test_expect_success 'recursive fetch with uninit submodule' '
>> +	# depends on previous test for setup
>> +
>> +	git -C main submodule deinit -f sub &&
>
> Here you are deiniting the submodule, such that 
> the Git directory will stay in .git/modules/sub. This is not the same thing
> as a submodule that was never initialized ("uninitialized"), for which .git/modules/sub
> will not yet exist. So maybe we could harden the tests by also testing
> for that scenario ? I don't know... maybe the infinite loop only happens
> if .git/modules/sub actually already exists. If so, the test name should be
> "recursive fetch with deinitialized submodule", I think.

Even if the original breakage happens only for deinitialized case, it would be sensible to test uninitialized one as well, I would think.

> Thanks for working on that, and sorry for not having the time to comment before
> you sent v2.
Thanks, all.  

It's not like we corral everybody to a single place on a single day to work on a single thing. Reviews ov v2 by reviewers who have not seen v1 is totally expected and very much appreciated.

Previous: Philippe BlainNext: Peter Kästle
Message 14 of 36 in “BUG in fetching non-checked out submodule”
  1. Ralf ThielowDec 2, 2020
  2. Philippe BlainDec 2, 2020
  3. Junio C HamanoDec 2, 2020
  4. Peter KästleDec 3, 2020
  5. Philippe BlainDec 3, 2020
  6. Peter KästleDec 3, 2020
  7. Junio C HamanoDec 3, 2020
  8. submodules: fix of regression on fetching of non-init subsub-repoPeter Kaestle, Dec 4, 2020
  9. Eric SunshineDec 4, 2020
  10. Peter KästleDec 7, 2020
  11. Eric SunshineDec 7, 2020
  12. submodules: fix of regression on fetching of non-init subsub-repoPeter Kaestle, Dec 7, 2020
  13. Philippe BlainDec 7, 2020
  14. Junio C HamanoDec 7, 2020
  15. Peter KästleDec 8, 2020
  16. Junio C HamanoDec 7, 2020
  17. Peter KästleDec 8, 2020
  18. Junio C HamanoDec 7, 2020
  19. Philippe BlainDec 7, 2020
  20. Junio C HamanoDec 7, 2020
  21. Junio C HamanoDec 7, 2020
  22. Peter KästleDec 8, 2020
  23. submodules: fix of regression on fetching of non-init subsub-repoPeter Kaestle, Dec 8, 2020
  24. Peter KästleDec 8, 2020
  25. Junio C HamanoDec 8, 2020
  26. Philippe BlainDec 8, 2020
  27. Peter KästleDec 9, 2020
  28. submodules: fix of regression on fetching of non-init subsub-repoPeter Kaestle, Dec 9, 2020
  29. Philippe BlainDec 9, 2020
  30. Ralf ThielowDec 3, 2020
  31. Peter KästleDec 3, 2020
  32. Ralf ThielowDec 3, 2020
  33. Peter KästleDec 3, 2020
  34. Ralf ThielowDec 3, 2020
  35. Peter KästleDec 3, 2020
  36. Ralf ThielowDec 3, 2020

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.