From: Daniel Black <daniel@mariadb.org>
To: git@vger.kernel.org
Subject:
Date: Tue, 8 Oct 2024 12:49:53 +1100 [thread overview]
Message-ID: <20241008015835.41678-1-daniel@mariadb.org> (raw)
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.
next prev parent reply other threads:[~2024-10-08 1:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 11:09 bug: submodule update fails to fetch Sergei Golubchik
2023-06-22 13:07 ` Taylor Blau
2023-06-22 16:39 ` Sergei Golubchik
2023-06-23 7:26 ` Jacob Keller
2024-10-01 7:24 ` [PATCH] submodule: correct remote name with fetch Daniel Black
2024-10-01 17:27 ` Junio C Hamano
2024-10-01 17:34 ` Junio C Hamano
2024-10-08 1:49 ` Daniel Black [this message]
2024-10-08 1:49 ` [RFC PATCH v2] " Daniel Black
2024-10-08 19:23 ` Junio C Hamano
2024-10-09 3:32 ` [PATCH v3] " Daniel Black
2024-10-09 17:51 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241008015835.41678-1-daniel@mariadb.org \
--to=daniel@mariadb.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).