git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wink Saville <wink@saville.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Alex Riesen <raa.lkml@gmail.com>, git@vger.kernel.org
Subject: Re: How-to combine several separate git repos?
Date: Sun, 09 Dec 2007 15:44:21 -0800	[thread overview]
Message-ID: <475C7DD5.9040209@saville.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0712091445470.5349@iabervon.org>

Daniel Barkalow wrote:
> On Sun, 9 Dec 2007, Wink Saville wrote:
>
>   
> I think that submodules do what you want. And they may not be ready for 
> neophytes to just use, but they're ready for neophytes to try using and 
> tell us where things get confused.
>   
<snip>
> 	-Daniel
I would like to try submodules and started to  read the man


I'll try submodules and I'll start by reading the man page,
I got to "add" and did the following:

wink@ic2d1:$ mkdir x
wink@ic2d1:$ cd x
wink@ic2d1:$ git init
Initialized empty Git repository in .git/
wink@ic2d1:$ git-submodule add ../android/StateMachine
remote (origin) does not have a url in .git/config
you must specify a repository to clone.
Clone of '' into submodule path 'StateMachine' failed

The documentation for "submodule add" says:

/git-submodule/ [--quiet] [-b branch] add <repository> [<path>]
Add the given repository as a submodule at the given path to the 
changeset to be committed next.

 From the above, <path> is ambiguous to me, is it referring to the 
source or destination. I continue reading and in the options section we 
find:

<path>

    Path to submodule(s). When specified this will restrict the command
    to only operate on the submodules found at the specified paths.


So it seems <path> is the for the source, but some how it can specify 
multiple paths. This seems to imply that I could add my three 
repositories with one command. But I have no idea how and there are no 
examples, but I can guess for my three repositories maybe:

wink@ic2d1:$ rm -rf *
wink@ic2d1:$ git init
Initialized empty Git repository in .git/
wink@ic2d1:$ git add submodule ../android StateMachine test2 test-annotation
fatal: '../android' is outside repository

Nope that didn't work, continue reading, ah I probably need to 
"submodule init" first.
It says:

init

    Initialize the submodules, i.e. register in .git/config each
    submodule name and url found in .gitmodules. The key used in
    .git/config is submodule.$name.url. This command does not alter
    existing information in .git/config.

This is garbally-gok to me (remember, neophyte) but it does leave a clue,
apparently I need to create .gitmodules so I do:

wink@ic2d1:$ cat .gitmodules
[submodule "StateMachine"]
        path = StateMachine
        url = ../android/StateMachine

[submodule "test2"]
        path = test2
        url = ../android/test2

[submodule "test-annotation"]
        path = test2
        url = ../android/test-annotation

So now I:

wink@ic2d1:$ cd ..
wink@ic2d1:$ rm -rf x
wink@ic2d1:$ mkdir x
wink@ic2d1:$ cd x
wink@ic2d1:$ git init
Initialized empty Git repository in .git/
wink@ic2d1:$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
wink@ic2d1:$ cp ../gitmodules .gitmodules
wink@ic2d1:$ cat .gitmodules
[submodule "StateMachine"]
        path = StateMachine
        url = ../android/StateMachine

[submodule "test2"]
        path = test2
        url = ../android/test2

[submodule "test-annotation"]
        path = test2
        url = ../android/test-annotation

wink@ic2d1:$ git submodule init
wink@ic2d1:$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true


That's not what I expected according to the documentation I was
expecting .git/config to now contain the [submodule "xxx"] sections
from .gitmodules? But maybe I've got to "submodule add" first or ...

Well, this isn't getting me anywhere so Daniel, I hope that gives
you some insight from a newbies point of view.

My first comment is that needs to be some examples in git submodule help.
Second, I'd suggest .gitmodules be called .gitsubmodules and that
the documentation have a related name. I went into the git/Documentation
directory in my clone of git and looked for "find . -iname '*sub*' and
the only relevant the files were for git-submodule I see no reason for there
not be a a .gitsubmodule. Actually, at the moment I see no reason for
this file at all, but that will probably become apparent soon:)
 
Note, my git current version is:

wink@ic2d1:$ git --version
git version 1.5.3.5.622.g6fd7a

I've cloned git and built locally so I can change to what ever version
is appropriate. For now I'll search around on the web


Thanks,

Wink Saville

  reply	other threads:[~2007-12-09 23:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-09  6:34 How-to combine several separate git repos? Wink Saville
2007-12-09 10:43 ` Alex Riesen
2007-12-09 19:12   ` Wink Saville
2007-12-09 19:55     ` Daniel Barkalow
2007-12-09 23:44       ` Wink Saville [this message]
2007-12-10  1:11         ` Daniel Barkalow
2007-12-10  2:29           ` Wink Saville
2007-12-10  3:01             ` Daniel Barkalow
2007-12-10  6:36               ` Wink Saville
2007-12-10  6:51                 ` Daniel Barkalow
2007-12-10  7:01                   ` Wink Saville
2007-12-10  7:52     ` Alex Riesen
2007-12-10 17:55       ` Wink Saville

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=475C7DD5.9040209@saville.com \
    --to=wink@saville.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    /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).