git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Filip Gospodinov <filip.gospodinov@monetas.net>, git@vger.kernel.org
Subject: Re: git submodule ignores --git-dir
Date: Fri, 11 Sep 2015 16:28:07 +0100	[thread overview]
Message-ID: <20150911152807.GA17201@serenity.lan> (raw)
In-Reply-To: <55F2F028.7070505@web.de>

On Fri, Sep 11, 2015 at 05:15:52PM +0200, Jens Lehmann wrote:
> Am 10.09.2015 um 22:06 schrieb Filip Gospodinov:
> > I know that for this particular use case I can just use `git clone --recursive`
> > and that other use cases can be worked around by using `cd`. Still, I wonder if
> > the behavior I discovered is a bug or if it's expected.
> 
> I don't think this is a bug. The git submodule command needs a work tree
> to read the .gitmodules file from, that's while it fails when using
> --git-dir from outside the work tree. But I admit that the error message
> "No submodule mapping found in .gitmodules for path ..." could be improved
> to clearly state that the .gitmodules file wasn't found.
> 
> Unfortunately trying to show git the right work tree:
> 
> $ git --git-dir=$PWD/repo2/.git --work-tree=$PWD/repo2 submodule update --init
> 
> Didn't work as I expected it to either:
> 
> fatal: /home/Sledge/libexec/git-core/git-submodule cannot be used without a working tree.
> 
> So you'll have to cd into the repo for now.

There's also "git -C /path/to/repo" which avoids the need for a separate
"cd".

  reply	other threads:[~2015-09-11 15:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10 20:06 git submodule ignores --git-dir Filip Gospodinov
2015-09-11 15:15 ` Jens Lehmann
2015-09-11 15:28   ` John Keeping [this message]
2015-09-14 13:25     ` Filip Gospodinov
  -- strict thread matches above, loose matches on Subject: below --
2015-09-10 20:06 Filip Gospodinov

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=20150911152807.GA17201@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=Jens.Lehmann@web.de \
    --cc=filip.gospodinov@monetas.net \
    --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).