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

Re: [PATCH v3 2/2] submodule: drop the top-level requirement

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 18, 2013, 23:54 UTC
Message-ID
<CAPig+cR7TS-sahgdZPkWkeE2Sy=GimGUVMSekgqtomWKfdiatA@mail.gmail.com>
In-Reply-To
<6e4122f3eedec3f520028b5598b78e0d59e5d12b.1366314439.git.john@keeping.me.uk>
On Thu, Apr 18, 2013 at 3:50 PM, John Keeping <john@keeping.me.uk> wrote:
Show 15 quoted lines
> Use the new rev-parse --prefix option to process all paths given to the
> submodule command, dropping the requirement that it be run from the
> top-level of the repository.
>
> Signed-off-by: John Keeping <john@keeping.me.uk>
> ---
> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> index ff26535..ca0a6ab 100755
> --- a/t/t7400-submodule-basic.sh
> +++ b/t/t7400-submodule-basic.sh
> @@ -212,6 +212,24 @@ test_expect_success 'submodule add with ./, /.. and // in path' '
>         test_cmp empty untracked
>  '
>
> +test_expect_success 'submodule add in subdir' '

A particularly minor nit. Existing subdirectory-related tests in t7400 spell out "subdirectory" fully, so perhaps for consistency: s/subdir/subdirectory/

Show 25 quoted lines
> +       echo "refs/heads/master" >expect &&
> +       >empty &&
> +
> +       mkdir addtest/sub &&
> +       (
> +               cd addtest/sub &&
> +               git submodule add "$submodurl" ../realsubmod3 &&
> +               git submodule init
> +       ) &&
> +
> +       rm -f heads head untracked &&
> +       inspect addtest/realsubmod3 ../.. &&
> +       test_cmp expect heads &&
> +       test_cmp expect head &&
> +       test_cmp empty untracked
> +'
> +
>  test_expect_success 'setup - add an example entry to .gitmodules' '
>         GIT_CONFIG=.gitmodules \
>         git config submodule.example.url git://example.com/init.git
> @@ -319,6 +337,15 @@ test_expect_success 'status should be "up-to-date" after update' '
>         grep "^ $rev1" list
>  '
>
> +test_expect_success 'status works correctly from a subdirectory' '
Good: "subdirectory"
Show 20 quoted lines
> +       mkdir sub &&
> +       (
> +               cd sub &&
> +               git submodule status >../list
> +       ) &&
> +       grep "^ $rev1" list
> +'
> +
>  test_expect_success 'status should be "modified" after submodule commit' '
>         (
>                 cd init &&
> diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
> index 30b429e..992b66b 100755
> --- a/t/t7401-submodule-summary.sh
> +++ b/t/t7401-submodule-summary.sh
> @@ -45,6 +45,20 @@ EOF
>         test_cmp expected actual
>  "
>
> +test_expect_success 'run summary from subdir' '

t7401 does not have any existing subdirectory-related tests, but for consistency with t7400, perhaps: s/subdir/subdirectory/

Show 15 quoted lines
> +       mkdir sub &&
> +       (
> +               cd sub &&
> +               git submodule summary >../actual
> +       ) &&
> +       cat >expected <<-EOF &&
> +* ../sm1 0000000...$head1 (2):
> +  > Add foo2
> +
> +EOF
> +       test_cmp expected actual
> +'
> +
>  commit_file sm1 &&
>  head2=$(add_file sm1 foo3)
Previous: Johannes Sixt
Message 39 of 39 in “submodule: drop the top-level requirement”
  1. 0/2 submodule: drop the top-level requirementJohn Keeping, Apr 7, 2013
  2. 1/2 rev-parse: add --filename-prefix optionJohn Keeping, Apr 7, 2013
  3. Jonathan NiederApr 7, 2013
  4. John KeepingApr 8, 2013
  5. Junio C HamanoApr 8, 2013
  6. John KeepingApr 8, 2013
  7. Junio C HamanoApr 8, 2013
  8. 2/2 submodule: drop the top-level requirementJohn Keeping, Apr 7, 2013
  9. Jens LehmannApr 7, 2013
  10. 0/2 submodule: drop the top-level requirementJohn Keeping, Apr 9, 2013
  11. 1/2 rev-parse: add --filename-prefix optionJohn Keeping, Apr 9, 2013
  12. Junio C HamanoApr 9, 2013
  13. John KeepingApr 9, 2013
  14. Junio C HamanoApr 9, 2013
  15. Ramkumar RamachandraApr 18, 2013
  16. John KeepingApr 18, 2013
  17. 2/2 submodule: drop the top-level requirementJohn Keeping, Apr 9, 2013
  18. Junio C HamanoApr 9, 2013
  19. John KeepingApr 9, 2013
  20. Ramkumar RamachandraApr 18, 2013
  21. John KeepingApr 18, 2013
  22. 0/2 submodule: drop the top-level requirementJohn Keeping, Apr 18, 2013
  23. 1/2 rev-parse: add --prefix optionJohn Keeping, Apr 18, 2013
  24. Ramkumar RamachandraApr 19, 2013
  25. John KeepingApr 19, 2013
  26. Ramkumar RamachandraApr 19, 2013
  27. John KeepingApr 19, 2013
  28. Ramkumar RamachandraApr 19, 2013
  29. 2/2 submodule: drop the top-level requirementJohn Keeping, Apr 18, 2013
  30. Junio C HamanoApr 18, 2013
  31. John KeepingApr 19, 2013
  32. Junio C HamanoApr 19, 2013
  33. Johannes SixtApr 19, 2013
  34. Junio C HamanoApr 19, 2013
  35. submodule: fix quoting in relative_path()John Keeping, Apr 24, 2013
  36. Junio C HamanoApr 24, 2013
  37. John KeepingApr 24, 2013
  38. Johannes SixtApr 24, 2013
  39. Eric SunshineApr 18, 2013

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.