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

Re: [PATCH v2] fetch: pass --no-write-fetch-head to subprocesses

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 8, 2023, 23:40 UTC
Message-ID
<xmqqjzzqrevv.fsf@gitster.g>
In-Reply-To
<xmqqttyurg4w.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> I think we should instead enumerate submodule repositories, instead
> of enumerating existing .git/FETCH_HEAD files.
Perhaps something along this line?
 t/t5526-fetch-submodules.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git c/t/t5526-fetch-submodules.sh w/t/t5526-fetch-submodules.sh
index 8ffb300f2d..dcdbe26a08 100755
--- c/t/t5526-fetch-submodules.sh
+++ w/t/t5526-fetch-submodules.sh
@@ -170,13 +170,13 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
 test_expect_success "fetch --recurse-submodules honors --no-write-fetch-head" '
 	(
 		cd downstream &&
-		fh=$(find . -name FETCH_HEAD -type f) &&
-		rm -f $fh &&
+		git submodule foreach --recursive \
+		sh -c "cd \"\$(git rev-parse --git-dir)\" && rm -f FETCH_HEAD" &&
+
 		git fetch --recurse-submodules --no-write-fetch-head &&
-		for f in $fh
-		do
-			test_path_is_missing $f || return 1
-		done
+
+		git submodule foreach --recursive \
+		sh -c "cd \"\$(git rev-parse --git-dir)\" && ! test -f FETCH_HEAD"
 	)
 '
 
Previous: Junio C HamanoNext: Eric Wong
Message 5 of 8 in “fetch: pass --no-write-fetch-head to subprocesses”
  1. fetch: pass --no-write-fetch-head to subprocessesEric Wong, Mar 8, 2023
  2. Junio C HamanoMar 8, 2023
  3. fetch: pass --no-write-fetch-head to subprocessesEric Wong, Mar 8, 2023
  4. Junio C HamanoMar 8, 2023
  5. Junio C HamanoMar 8, 2023
  6. Eric WongMar 8, 2023
  7. Junio C HamanoMar 9, 2023
  8. Jeff KingMar 9, 2023

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.