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

(no subject)

From
Daniel Black <daniel@mariadb.org>
Date
Oct 8, 2024, 01:49 UTC
Message-ID
<20241008015835.41678-1-daniel@mariadb.org>
In-Reply-To
<xmqq7carzpzi.fsf@gitster.g>
I have this so far, but I need a hand with the test case.
With a manual hack of the code:
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2450,7 +2450,7 @@ static int run_update_procedure(const struct update_data *ud)
                 * Now we tried the usual fetch, but `oid` may
                 * not be reachable from any of the refs.
                 */
-               if (!is_tip_reachable(ud->sm_path, &ud->oid) &&
+               if (is_tip_reachable(ud->sm_path, &ud->oid) &&
                    fetch_in_submodule(ud->sm_path, ud->depth, ud->quiet, &ud->oid))
                        return die_message(_("Fetched in submodule path '%s', but it did not "
                                             "contain %s. Direct fetching of that commit failed."),

I'm able to using the GIT_TRACE= of git submodule update arrive at the
correct fetching from origin in the test case where before the code fix
it was fetching from remote o1.

trace: run_command: cd sub; unset GIT_PREFIX; GIT_DIR=.git git rev-list -n 1 27fe1b65df6f55a58636afcba364dfcb64916cd6 --not --all
trace: start_command: /home/dan/repos/git/git rev-list -n 1 27fe1b65df6f55a58636afcba364dfcb64916cd6 --not --all
trace: built-in: git rev-list -n 1 27fe1b65df6f55a58636afcba364dfcb64916cd6 --not --all
trace: run_command: cd sub; unset GIT_PREFIX; GIT_DIR=.git git rev-list -n 1 27fe1b65df6f55a58636afcba364dfcb64916cd6 --not --all
trace: start_command: /home/dan/repos/git/git rev-list -n 1 27fe1b65df6f55a58636afcba364dfcb64916cd6 --not --all
trace: built-in: git rev-list -n 1 27fe1b65df6f55a58636afcba364dfcb64916cd6 --not --all
trace: run_command: cd sub; unset GIT_PREFIX; GIT_DIR=.git git fetch origin 27fe1b65df6f55a58636afcba364dfcb64916cd6
trace: start_command: /home/dan/repos/git/git fetch origin 27fe1b65df6f55a58636afcba364dfcb64916cd6

As Sergei said in the original referenced message "a submodule where the commit cannot be fetched by simply
`git fetch` and needs a direct fetch".

So this is the test case that I'm having trouble generating.
Previous: Junio C HamanoNext: Daniel Black
Message 8 of 12 in “bug: submodule update fails to fetch”
  1. Sergei GolubchikJun 22, 2023
  2. Taylor BlauJun 22, 2023
  3. Sergei GolubchikJun 22, 2023
  4. Jacob KellerJun 23, 2023
  5. submodule: correct remote name with fetchDaniel Black, Oct 1, 2024
  6. Junio C HamanoOct 1, 2024
  7. Junio C HamanoOct 1, 2024
  8. Daniel Black, Oct 8, 2024
  9. submodule: correct remote name with fetchDaniel Black, Oct 8, 2024
  10. Junio C HamanoOct 8, 2024
  11. submodule: correct remote name with fetchDaniel Black, Oct 9, 2024
  12. Junio C HamanoOct 9, 2024

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.