All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: John Szakmeister <john@szakmeister.net>
Cc: Git mailing list <git@vger.kernel.org>
Subject: Re: Nesting a submodule inside of another...
Date: Wed, 13 Jul 2011 23:20:39 +0200	[thread overview]
Message-ID: <4E1E0C27.60903@web.de> (raw)
In-Reply-To: <CAEBDL5U0F+QaqhW92i-s82-C9fj2knp6JPNtNvgdJY68kRYwWQ@mail.gmail.com>

Am 13.07.2011 03:21, schrieb John Szakmeister:
> On Tue, Jul 12, 2011 at 3:23 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
>> Submodules are repositories of their own, so their work tree is outside
>> the superproject's work tree. You're attempting to have a submodule of
>> the superproject inside another submodule of the superproject, but this
>> won't work because it does not live in the superproject's work tree (as
>> that doesn't include submodules and their subdirectories).
> 
> I guess I still don't see how that's a problem.  It seems to me that
> for the superproject the ignore rule needs to be:
>   ignore framework1, except framework1/module

But that would mean the superproject would have to scan framework1's
work tree for changes too, which is conflicting with the idea that each
submodule is a repo of it's own, so that won't fly.

> And then it could check its status.  Of course, framework1 would
> somehow need to know to ignore it... and I'm not sure how that can be
> communicated.

It can't be communicated, as submodules are unaware of their superproject.
And adding module manually to framework1's .gitignore is just a problem
waiting to happen. Having a file or submodule in the work tree of one
git repository being referenced by another is just asking for trouble ...

>> But at least since 1.6.2 git should issue a meaningful error message.
>> With current master I get:
>>
>> $ git add sub/file
>> fatal: Path 'sub/file' is in submodule 'sub'
> 
> Sorry, I wasn't trying to do a 'git add'.  I was trying to do a 'git
> submodule add'.

Ok.

>> What version are you using?
> 
> I'm using 1.7.6rc3.  I updated to the latest trunk and still get the same error:
> 
> :: git submodule add $PWD/../c b/c
> The following path is ignored by one of your .gitignore files:
> b/c
> Use -f if you really want to add it.

You're right, the error message of "git submodule add" should be better
here.

  reply	other threads:[~2011-07-13 21:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 12:01 Nesting a submodule inside of another John Szakmeister
2011-07-12 19:23 ` Jens Lehmann
2011-07-13  1:21   ` John Szakmeister
2011-07-13 21:20     ` Jens Lehmann [this message]
2011-07-13 21:27       ` Junio C Hamano
2011-07-13 22:04         ` Jens Lehmann
2011-07-13 22:44           ` Junio C Hamano
2011-07-14  9:36       ` John Szakmeister
2011-07-14 14:33         ` Seth Robertson
2011-07-15  8:34           ` John Szakmeister
2011-07-13  8:43 ` Andreas Ericsson

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=4E1E0C27.60903@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=john@szakmeister.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.