All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jehan Bing <jehan@orb.com>
To: git@vger.kernel.org
Subject: [BUG] Fail to add a module in a subdirectory if module is already cloned
Date: Tue, 24 Jan 2012 11:11:55 -0800	[thread overview]
Message-ID: <jfmvpp$4v7$1@dough.gmane.org> (raw)

Hi,

I'm getting an error if I try to add a module in a subdirectory and that 
module is already cloned.
Here are the steps to reproduce (git 1.7.8.3):

git init module
cd module
echo foo > foo
git add foo
git commit -m "init"
cd ..
git init super
cd super
echo foo > foo
git add foo
git commit -m "init"
git branch b1
git branch b2
git checkout b1
git submodule add ../module lib/module
git commit -m "module"
git checkout b2
rm -rf lib
git submodule add ../module lib/module

The last command returns:
     fatal: Not a git repository: ../.git/modules/lib/module
     Unable to checkout submodule 'lib/module'

The file lib/modules/.git contains:
     gitdir: ../.git/modules/lib/module
(missing an additional "../")

In branch b1, after adding the module, the file contained the full path:
     gitdir: /[...]/super/.git/modules/lib/module
Or contains the correct relative path after checking out b1 later:
     gitdir: ../../.git/modules/lib/module


Regards,
	Jehan

             reply	other threads:[~2012-01-24 19:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24 19:11 Jehan Bing [this message]
2012-01-24 21:10 ` [BUG] Fail to add a module in a subdirectory if module is already cloned Jens Lehmann
2012-01-24 21:13   ` Jens Lehmann
2012-01-24 21:24   ` Junio C Hamano
2012-01-24 21:44     ` Jens Lehmann
2012-01-24 22:14       ` Jens Lehmann
2012-01-24 22:38         ` Junio C Hamano
2012-01-24 21:49   ` [PATCH] submodule add: fix breakage when re-adding a deep submodule Jens Lehmann
2012-01-25  1:48     ` Jehan Bing

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='jfmvpp$4v7$1@dough.gmane.org' \
    --to=jehan@orb.com \
    --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 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.