git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stefan Näwe" <stefan.naewe+git@gmail.com>
To: git@vger.kernel.org
Subject: git add on existing sub-repository
Date: Wed, 15 Jul 2009 13:50:56 +0000 (UTC)	[thread overview]
Message-ID: <loom.20090715T134313-679@post.gmane.org> (raw)

I found a weirdness with git add and submodules. 
I did:
 - create 2 repos: subtest, mod1
 - cloned mod1 into subtest
 - in 'subtest': git add mod1

'mod1' gets added as a submodule, but no '.gitmodules' files is written.

Bug ? Feature ?

Thanks for any reply.

Stefan


P.S. Here's a 'script' log of what 
I did (git-make-initial simply creates a new repo with a single commit):

~/tmp$ git version
git version 1.6.3.3

~/tmp$ cat ~/bin/git-make-initial
#!/bin/sh
me=$(basename $0)
if [ ! -z "$1" ]; then
	dir=$1
	test -d $dir || mkdir $dir
else
	dir=.
fi
test -d $dir/.git && (echo "$me: '.git' exists; Not creating initial commit" ; 
exit -1)
test -d $dir/.git || (cd $dir ; git init ; test -f .gitignore || cp 
.git/info/exclude .gitignore ; git add . ; git ci -s -m"Initial commit created 
by $me")

~/tmp$ git-make-initial subtest
Initialized empty Git repository in /home/naewe/tmp/subtest/.git/
[master (root-commit) 8ab9920] Initial commit created by git-make-initial
 1 files changed, 6 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore

~/tmp$ git-make-initial mod1
Initialized empty Git repository in /home/naewe/tmp/mod1/.git/
[master (root-commit) 3671274] Initial commit created by git-make-initial
 1 files changed, 6 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore

~/tmp$ ls -la subtest mod1
mod1:
insgesamt 11
drwxr-xr-x  3 naewe naewe  104 2009-07-15 15:38 .
drwx------ 13 naewe naewe 6992 2009-07-15 15:38 ..
drwxr-xr-x  8 naewe naewe  328 2009-07-15 15:38 .git
-rw-r--r--  1 naewe naewe  240 2009-07-15 15:38 .gitignore

subtest:
insgesamt 11
drwxr-xr-x  3 naewe naewe  104 2009-07-15 15:38 .
drwx------ 13 naewe naewe 6992 2009-07-15 15:38 ..
drwxr-xr-x  8 naewe naewe  328 2009-07-15 15:38 .git
-rw-r--r--  1 naewe naewe  240 2009-07-15 15:38 .gitignore

~/tmp$ cd subtest
~/tmp/subtest$ git clone ~/tmp/mod1
Initialized empty Git repository in /home/naewe/tmp/subtest/mod1/.git/
~/tmp/subtest$ git add mod1
~/tmp/subtest$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	new file:   mod1
#
# Modified submodules:
#
# * mod1 0000000...3671274 (1):
#   > Initial commit created by git-make-initial
#
~/tmp/subtest$ ls -a
.  ..  .git  .gitignore  mod1
~/tmp/subtest$

                 reply	other threads:[~2009-07-15 13:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=loom.20090715T134313-679@post.gmane.org \
    --to=stefan.naewe+git@gmail.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 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).