git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Peter Kästle" <peter.kaestle@nokia.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, christian.couder@gmail.com, pc44800@gmail.com
Subject: Re: [PATCH v2] Fix status of initialized but not cloned submodules
Date: Mon, 27 Jan 2020 09:52:21 +0100	[thread overview]
Message-ID: <41a835a3-3809-eda8-fb3c-30fe9fac1a24@nokia.com> (raw)
In-Reply-To: <xmqqblqs3hbv.fsf@gitster-ct.c.googlers.com>

Hi,

On 24.01.20 18:16, Junio C Hamano wrote:
> Peter Kästle <peter.kaestle@nokia.com> writes:

[...]

>> Is 3) even a possible use-case?
> 
> That would be somebody who is about to add a submodule to an
> existing project, right?  You have a top-level project, you need
> somebody else's project as its submodule or you need to use a
> library in your top-level project and you develop the library
> yourself, but want to keep that library part separate from its first
> user which is your top-level project.  So in the working tree of a
> top-level project you either "git init lib/" and start the submodule
> project right there, or "git clone $URL_of_upstream_of_lib lib/",
> and then plan to do "git submodule add lib", but haven't done so
> yet.  .gitmodules does not know about it, but the directory is
> already populated and is a valid repository.

You are right, this is a possible scenario for 3).  However the question 
about how the outer git repo should behave is still open to me.  I mean, 
the outer git repo should treat the inner one as standard file structure 
and not as a submodule until the user explicitly calls the "git 
submodule add" command.  And thus "git submodule status" should 
completely skip it.  Calling "git status" in the outer repo should list 
the inner one as "untracked" or?
At least this is, what I would expect.
So from my point of view the only test for 3) we could do is something 
like this:
mkdir innerfoo &&
(cd innerfoo &&
git init) &&
test_must_fail git submodule status | grep "innerfoo"


>> Besides that, I think testcases for man git-submodule's description of
>> status on merge conflicts are missing (...[prefix] U if the submodule
>> has merge conflicts).
> 
> Nice to know.  Thanks.

Maybe I'll have spare time next weekend to create some.  Not to promise 
anything, but sounds like fun.

-- 
best regards,
--peter;

  reply	other threads:[~2020-01-27  8:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 14:02 [PATCH] Fix submodule status of dirs initialized but empty Peter Kästle
2020-01-21 10:12 ` [PATCH v2] Fix status of initialized but not cloned submodules Peter Kaestle
2020-01-23 21:12   ` Junio C Hamano
2020-01-24 10:34     ` [PATCH v3 1/2] Testcase for submodule status on empty dirs Peter Kaestle
2020-01-24 10:34       ` [PATCH v3 2/2] Fix status of initialized but not cloned submodules Peter Kaestle
2020-01-24 17:35       ` [PATCH v3 1/2] Testcase for submodule status on empty dirs Junio C Hamano
2020-01-27  9:06         ` [PATCH v4 1/2] t7400: add a testcase " Peter Kaestle
2020-01-27  9:06           ` [PATCH v4 2/2] Fix status of initialized but not cloned submodules Peter Kaestle
2020-01-27 18:15           ` [PATCH v4 1/2] t7400: add a testcase for submodule status on empty dirs Junio C Hamano
2020-01-28  8:16             ` Peter Kästle
2020-02-02 23:32             ` [PATCH] t7400: testcase for submodule status on unregistered inner git repos Peter Kaestle
2020-01-24 11:55     ` [PATCH v2] Fix status of initialized but not cloned submodules Peter Kästle
2020-01-24 17:16       ` Junio C Hamano
2020-01-27  8:52         ` Peter Kästle [this message]
2020-01-27 18:18           ` Junio C Hamano
2020-02-02 23:16         ` Peter Kästle

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41a835a3-3809-eda8-fb3c-30fe9fac1a24@nokia.com \
    --to=peter.kaestle@nokia.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pc44800@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).