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

Re: [PATCH v4 1/3] fetch/pull: Add the --recurse-submodules option

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 12, 2010, 19:54 UTC
Message-ID
<20101112195453.GA25248@burratino>
In-Reply-To
<4CDD391C.2000905@web.de>
Jens Lehmann wrote:
> Ok, here is the updated version of patch 1/3 making "--submodule-prefix" a
> hidden option which is not documented in Documentation/fetch-options.txt .

Oh, I missed that you were proposing leaving it undocumented. On one hand, it is nice when debugging if all options are documented; but on the other hand, there is precedent in --rebasing for hiding implementation details like this. Unlike -h output, the manual is not so space-constrainted, so...

Show 25 quoted lines
> --- /dev/null
> +++ b/t/t5526-fetch-submodules.sh
> @@ -0,0 +1,109 @@
> +#!/bin/sh
> +# Copyright (c) 2010, Jens Lehmann
> +
> +test_description='Recursive "git fetch" for submodules'
> +
> +. ./test-lib.sh
> +
> +pwd=$(pwd)
> +
> +add_upstream_commit() {
> +	(
> +		cd submodule &&
> +		head1=$(git rev-parse --short HEAD) &&
> +		echo new >> subfile &&
> +		test_tick &&
> +		git add subfile &&
> +		git commit -m new subfile &&
> +		head2=$(git rev-parse --short HEAD) &&
> +		echo "From $pwd/submodule" > ../expect.err &&
> +		echo "   $head1..$head2  master     -> origin/master" >> ../expect.err
> +	)
> +	(
Missing &&?

Hope that helps. These are just tiny nitpicks; I am happy with the patch with or without them.

diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index 594f7ce..a9cb8ab 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt
@@ -67,6 +67,13 @@ endif::git-pull[]
 --recurse-submodules::
 	Use this option to fetch new commits of all populated submodules too.
 
+ifndef::git-pull[]
+--submodule-prefix=<path>::
+	Prepend <path> to paths printed in informative messages
+	such as "Fetching submodule foo".  This option is used
+	internally when recursing over submodules.
+endif::git-pull[]
+
 -u::
 --update-head-ok::
 	By default 'git fetch' refuses to update the head which
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index 107317a..9c1d3a0 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -18,7 +18,7 @@ add_upstream_commit() {
 		head2=$(git rev-parse --short HEAD) &&
 		echo "From $pwd/submodule" > ../expect.err &&
 		echo "   $head1..$head2  master     -> origin/master" >> ../expect.err
-	)
+	) &&
 	(
 		cd deepsubmodule &&
 		head1=$(git rev-parse --short HEAD) &&
Previous: Jens LehmannNext: Jens Lehmann
Message 19 of 24 in “Teach fetch and pull to recursively fetch submodules”
  1. 0/3 Teach fetch and pull to recursively fetch submodulesJens Lehmann, Nov 10, 2010
  2. 1/3 fetch/pull: Add the --recurse-submodules optionJens Lehmann, Nov 10, 2010
  3. 2/3 Add the 'fetch.recurseSubmodules' config settingJens Lehmann, Nov 10, 2010
  4. Jonathan NiederNov 11, 2010
  5. Jens LehmannNov 11, 2010
  6. Jonathan NiederNov 11, 2010
  7. Junio C HamanoNov 11, 2010
  8. Jonathan NiederNov 11, 2010
  9. Jens LehmannNov 12, 2010
  10. Jonathan NiederNov 12, 2010
  11. Jens LehmannNov 12, 2010
  12. Jonathan NiederNov 12, 2010
  13. Jens LehmannNov 12, 2010
  14. Jens LehmannNov 12, 2010
  15. 3/3 Submodules: Add the "fetchRecurseSubmodules" config optionJens Lehmann, Nov 10, 2010
  16. Jonathan NiederNov 11, 2010
  17. Jens LehmannNov 11, 2010
  18. 1/3 fetch/pull: Add the --recurse-submodules optionJens Lehmann, Nov 12, 2010
  19. Jonathan NiederNov 12, 2010
  20. Jens LehmannNov 12, 2010
  21. Junio C HamanoDec 9, 2010
  22. Jens LehmannDec 9, 2010
  23. Junio C HamanoDec 10, 2010
  24. Jens LehmannDec 10, 2010

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.