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

Re: [PATCH 2/2] submodule: Add --dissociate option to add/update commands

From
Stefan Beller <sbeller@google.com>
Date
May 1, 2018, 20:23 UTC
Message-ID
<CAGZ79kY686ptTPY8DVwr79F2vC6eC_BP=5M7isu9Gfu+eX7vDg@mail.gmail.com>
In-Reply-To
<20180501180908.17443-3-kcghost@gmail.com>
On Tue, May 1, 2018 at 11:09 AM, Casey Fitzpatrick <kcghost@gmail.com> wrote:
Show 9 quoted lines
>
> +test_expect_success 'submodule add --reference with --dissociate doesnt use alternates' '
> +       (
> +               cd super &&
> +               git submodule add --reference ../B --dissociate "file://$base_dir/A" sub-dissociate &&
> +               git commit -m B-super-added &&
> +               git repack -ad
> +       ) &&
> +       test_must_fail test_alternate_is_used super/.git/modules/sub-dissociate/objects/info/alternates super/sub-dissociate

We do already have the unfortunate precedent of using "test_must_fail test_alternate_is_used" (and it was partially included by me in 31224cbdc72 (clone: recursive and reference option triggers submodule alternates, 2016-08-17), further used in bf03b790471 (submodule--helper: set alternateLocation for cloned submodules, 2016-12-08).

I think it is the wrong approach though, as the test_must_fail only ensure that *something* doesn't return success. Usually we use it with "test_must_fail git ..." to ensure we properly error out on user requests, that are impossible to fulfill in the current implementation.

For this test case I'd suggest we rather test that the no alternate is setup,
    test_path_is_missing
super/.git/modules/sub-dissociate/objects/info/alternates
as that tests the correctness of the --dissociate option?

Thanks, Stefan

Previous: Casey FitzpatrickNext: Eric Sunshine
Message 12 of 29 in “git-submodule is missing --dissociate option”
  1. Casey FitzpatrickApr 30, 2018
  2. Casey FitzpatrickApr 30, 2018
  3. Ævar Arnfjörð BjarmasonApr 30, 2018
  4. Junio C HamanoMay 2, 2018
  5. Stefan BellerApr 30, 2018
  6. Casey FitzpatrickApr 30, 2018
  7. 0/2 Add --progress and --dissociate to git submoduleCasey Fitzpatrick, May 1, 2018
  8. 1/2 submodule: Add --progress option to add commandCasey Fitzpatrick, May 1, 2018
  9. Stefan BellerMay 1, 2018
  10. Casey FitzpatrickMay 1, 2018
  11. 2/2 submodule: Add --dissociate option to add/update commandsCasey Fitzpatrick, May 1, 2018
  12. Stefan BellerMay 1, 2018
  13. Eric SunshineMay 1, 2018
  14. Casey FitzpatrickMay 1, 2018
  15. Stefan BellerMay 1, 2018
  16. 0/3 Add --progress and --dissociate to git submoduleCasey Fitzpatrick, May 2, 2018
  17. 1/3 submodule: clean up subsititions in scriptCasey Fitzpatrick, May 2, 2018
  18. 2/3 submodule: add --progress option to add commandCasey Fitzpatrick, May 2, 2018
  19. 3/3 submodule: add --dissociate option to add/update commandsCasey Fitzpatrick, May 2, 2018
  20. Casey FitzpatrickMay 2, 2018
  21. 0/3 Add --progress and --dissociate to git submoduleCasey Fitzpatrick, May 2, 2018
  22. 1/3 submodule: clean up subsititions in scriptCasey Fitzpatrick, May 2, 2018
  23. Junio C HamanoMay 2, 2018
  24. Casey FitzpatrickMay 3, 2018
  25. 2/3 submodule: add --progress option to add commandCasey Fitzpatrick, May 2, 2018
  26. 3/3 submodule: add --dissociate option to add/update commandsCasey Fitzpatrick, May 2, 2018
  27. Junio C HamanoMay 2, 2018
  28. Casey FitzpatrickMay 2, 2018
  29. Junio C HamanoMay 2, 2018

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.