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

Re: [PATCH] shallow clone to not imply shallow submodules

From
Jeff King <peff@peff.net>
Date
Jun 20, 2016, 17:13 UTC
Message-ID
<20160620171312.GA1880@sigill.intra.peff.net>
In-Reply-To
<1466441998-18896-1-git-send-email-sbeller@google.com>
On Mon, Jun 20, 2016 at 09:59:58AM -0700, Stefan Beller wrote:
Show 8 quoted lines
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> 
> Hi Junio, Peff,
> 
> I thought about this patch squashed into  
> "clone: do not let --depth imply --shallow-submodules" will actually test
> for the regression.
Yep, it looks good to me.
Show 14 quoted lines
> +test_expect_success 'shallow clone does not imply shallow submodule' '
> +	test_when_finished "rm -rf super_clone" &&
> +	git clone --recurse-submodules --depth 2 "file://$pwd/." super_clone &&
> +	(
> +		cd super_clone &&
> +		git log --oneline >lines &&
> +		test_line_count = 2 lines
> +	) &&
> +	(
> +		cd super_clone/sub &&
> +		git log --oneline >lines &&
> +		test_line_count = 3 lines
> +	)
> +'

This follows the style of the other tests, so it's the right thing here. But as a style suggestion, I think:

  git -C super_clone/sub log --oneline >lines &&
  test_line_count = 3 lines
is nicer than the subshell. It's more succinct, and it saves a process.
-Peff
Previous: Stefan BellerNext: Stefan Beller
Message 12 of 17 in “[BUG REPORT] git 2.9.0 clone --recursive fails on cloning a submodule”
  1. Vadim EisenbergJun 19, 2016
  2. Jeff KingJun 19, 2016
  3. Vadim EisenbergJun 19, 2016
  4. Jeff KingJun 19, 2016
  5. Junio C HamanoJun 19, 2016
  6. Jeff KingJun 20, 2016
  7. Stefan BellerJun 20, 2016
  8. Vadim EisenbergJun 20, 2016
  9. Dennis KaarsemakerJun 20, 2016
  10. Jeff KingJun 20, 2016
  11. shallow clone to not imply shallow submodulesStefan Beller, Jun 20, 2016
  12. Jeff KingJun 20, 2016
  13. Stefan BellerJun 20, 2016
  14. Jeff KingJun 20, 2016
  15. Ævar Arnfjörð BjarmasonApr 19, 2017
  16. Stefan BellerApr 19, 2017
  17. Duy NguyenJun 21, 2016

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.