From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] submodule.c: warn about missing submodule git directories
Date: Tue, 28 Aug 2018 14:49:19 -0700 [thread overview]
Message-ID: <CAGZ79kYApAdFzC82LZNjYDzL5uWxtXHbvqUyjZ9OF+b=pGNbUA@mail.gmail.com> (raw)
In-Reply-To: <xmqqtvnefhgx.fsf@gitster-ct.c.googlers.com>
On Tue, Aug 28, 2018 at 11:56 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Stefan Beller <sbeller@google.com> writes:
>
> > This is the continuation of f2d48994dc1 (submodule.c: submodule_move_head
> > works with broken submodules, 2017-04-18), which tones down the case of
> > "broken submodule" in case of a missing git directory of the submodule to
> > be only a warning.
>
> After seeing this warning, as we do not do any remedial action in
> this codepath, the user with a repository in this state will keep
> seeing the 'missing' message. Wouldn't we want to give a hint in
> addition (e.g. 'you can run "git submodule update $name" to
> recover', or something like that)?
Not quite, as this is only triggered in the case of 'old_head = NULL', which
is when you have a superproject that is missing the submodule in the
working tree before and wants to have it afterwards.
Looking at the test in the previous patch, I would think a reasonable workflow
in the test is
git clone --recurse-submodules super1 super1_clone && cd super1_clone
git checkout --recurse-submodules historic_state
# see warning, but checkout proceeds
git fetch --recurse-submodules
# clones the submodule as it was configured active via the clone
git checkout --recurse-submodules historic_state
# this checkout will put the submodule in place
# not sure if -f is needed here, though.
I am currently working on the cloning of submodules that are not currently
in the working tree while fetching in the superproject, which would address
the latter part.
> The MOVE_HEAD_FORCE codepath that follows this hunk is, eh, already
> forcing to correct the situation, so there is no need to touch that,
> which makes sense, if I understand correctly.
No, that is not executed for now as it depends on 'old_head'.
In case of FORCE we might want to die instead of just warn about that submodule.
Stefan
next prev parent reply other threads:[~2018-08-28 21:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-27 22:12 [PATCH 1/2] t2013: add test for missing but active submodule Stefan Beller
2018-08-27 22:12 ` [PATCH 2/2] submodule.c: warn about missing submodule git directories Stefan Beller
2018-08-28 18:56 ` Junio C Hamano
2018-08-28 21:49 ` Stefan Beller [this message]
2018-08-29 17:16 ` Junio C Hamano
2018-08-29 20:32 ` Stefan Beller
2018-09-05 19:18 ` Jonathan Nieder
2018-09-07 18:49 ` Stefan Beller
2018-09-07 19:53 ` Jonathan Nieder
2018-08-29 21:04 ` [PATCH 1/2] t2013: add test for missing but active submodule SZEDER Gábor
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='CAGZ79kYApAdFzC82LZNjYDzL5uWxtXHbvqUyjZ9OF+b=pGNbUA@mail.gmail.com' \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).