{"thread":{"id":"20120","subject":"git add on existing sub-repository","startedAt":"2009-07-15T13:50:56Z","lastAt":"2009-07-15T13:50:56Z","messageCount":1,"participants":["Stefan Näwe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"118022","messageId":"loom.20090715T134313-679@post.gmane.org","threadId":"20120","inReplyTo":null,"subject":"git add on existing sub-repository","fromName":"Stefan Näwe","fromEmail":"stefan.naewe+git@gmail.com","sentAt":"2009-07-15T13:50:56Z","receivedAt":"2009-07-15T13:50:56Z","isPatch":false,"sender":{"key":"stefan.naewe+git@gmail.com","avatar":"https://gravatar.com/avatar/ff9c89e7b42e5c7f494ef0f19ac9bde6693fb6465356711b8d4ed47d2108dd46?d=mp&s=160"},"body":"I found a weirdness with git add and submodules. \nI did:\n - create 2 repos: subtest, mod1\n - cloned mod1 into subtest\n - in 'subtest': git add mod1\n\n'mod1' gets added as a submodule, but no '.gitmodules' files is written.\n\nBug ? Feature ?\n\nThanks for any reply.\n\nStefan\n\n\nP.S. Here's a 'script' log of what \nI did (git-make-initial simply creates a new repo with a single commit):\n\n~/tmp$ git version\ngit version 1.6.3.3\n\n~/tmp$ cat ~/bin/git-make-initial\n#!/bin/sh\nme=$(basename $0)\nif [ ! -z \"$1\" ]; then\n\tdir=$1\n\ttest -d $dir || mkdir $dir\nelse\n\tdir=.\nfi\ntest -d $dir/.git && (echo \"$me: '.git' exists; Not creating initial commit\" ; \nexit -1)\ntest -d $dir/.git || (cd $dir ; git init ; test -f .gitignore || cp \n.git/info/exclude .gitignore ; git add . ; git ci -s -m\"Initial commit created \nby $me\")\n\n~/tmp$ git-make-initial subtest\nInitialized empty Git repository in /home/naewe/tmp/subtest/.git/\n[master (root-commit) 8ab9920] Initial commit created by git-make-initial\n 1 files changed, 6 insertions(+), 0 deletions(-)\n create mode 100644 .gitignore\n\n~/tmp$ git-make-initial mod1\nInitialized empty Git repository in /home/naewe/tmp/mod1/.git/\n[master (root-commit) 3671274] Initial commit created by git-make-initial\n 1 files changed, 6 insertions(+), 0 deletions(-)\n create mode 100644 .gitignore\n\n~/tmp$ ls -la subtest mod1\nmod1:\ninsgesamt 11\ndrwxr-xr-x  3 naewe naewe  104 2009-07-15 15:38 .\ndrwx------ 13 naewe naewe 6992 2009-07-15 15:38 ..\ndrwxr-xr-x  8 naewe naewe  328 2009-07-15 15:38 .git\n-rw-r--r--  1 naewe naewe  240 2009-07-15 15:38 .gitignore\n\nsubtest:\ninsgesamt 11\ndrwxr-xr-x  3 naewe naewe  104 2009-07-15 15:38 .\ndrwx------ 13 naewe naewe 6992 2009-07-15 15:38 ..\ndrwxr-xr-x  8 naewe naewe  328 2009-07-15 15:38 .git\n-rw-r--r--  1 naewe naewe  240 2009-07-15 15:38 .gitignore\n\n~/tmp$ cd subtest\n~/tmp/subtest$ git clone ~/tmp/mod1\nInitialized empty Git repository in /home/naewe/tmp/subtest/mod1/.git/\n~/tmp/subtest$ git add mod1\n~/tmp/subtest$ git status\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#\tnew file:   mod1\n#\n# Modified submodules:\n#\n# * mod1 0000000...3671274 (1):\n#   > Initial commit created by git-make-initial\n#\n~/tmp/subtest$ ls -a\n.  ..  .git  .gitignore  mod1\n~/tmp/subtest$\n"}]}