git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Questions about repo and git submodule
@ 2008-12-23 14:01 Emily Ren
  2008-12-23 15:29 ` Shawn O. Pearce
  0 siblings, 1 reply; 4+ messages in thread
From: Emily Ren @ 2008-12-23 14:01 UTC (permalink / raw)
  To: Git Mailinglist

All,

I have some questions about android repo and git submodule.

I created a repo repository with below commands:
1.  repo init -u git://android.git.kernel.org/platform/manifest.git
2.  repo initialized in /android

1. The android dir is not a git repository, if other people clone my
android code, how does it work?
2. I want to make android dir to be a git repository, is it workable
that I create submodule for each subdirectory in another directory? Is
there a script for it?

Thank you !

Emily

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Questions about repo and git submodule
  2008-12-23 14:01 Questions about repo and git submodule Emily Ren
@ 2008-12-23 15:29 ` Shawn O. Pearce
  2008-12-25  6:28   ` Emily Ren
  0 siblings, 1 reply; 4+ messages in thread
From: Shawn O. Pearce @ 2008-12-23 15:29 UTC (permalink / raw)
  To: Emily Ren; +Cc: Git Mailinglist

Emily Ren <lingyan.ren@gmail.com> wrote:
> 
> I have some questions about android repo and git submodule.
> 
> I created a repo repository with below commands:
> 1.  repo init -u git://android.git.kernel.org/platform/manifest.git
> 2.  repo initialized in /android
> 
> 1. The android dir is not a git repository,

Correct, it is not a git repository.  The repo tool does not use
git submodules.  The top level of a repo client has a ".repo/"
directory with metadata, not a ".git/" directory.  The table of
contents (the subprojects) is stored in XML files under ".repo/".

<aside>
I actually fought against the XML format for repo's manifest, but
others felt it was suitable.  And then walked away from the project
after Android open-sourced its code tree.  Leaving me to maintain it.
I see a file format simplification in the future for repo.
</aside>

> if other people clone my
> android code, how does it work?

Sadly this isn't supported correctly.  You can't initialize one
repo client from another, even though you can git clone one git
repository from any other.  Its a bug in repo's design.  The data
under ".repo/projects/" isn't laid out correctly to permit reuse
of one repo client to initialize another.

Its something I keep meaning to fix, but its going to take some
real effort.

In the mean time, there is a "--mirror" flag to repo init
which can be used to clone everything into bare repositories.
Those bare repositories can be published for others to repo init
from, though you need to customize the manifest.git:default.xml
so that the embedded URL refers back to your server and not
android.git.kernel.org.  Yet another thing I want to fix.

> 2. I want to make android dir to be a git repository, is it workable
> that I create submodule for each subdirectory in another directory? Is
> there a script for it?

You might be able to do something like this:

	cd /android
	git init
	repo forall -c 'cd /android && git submodule add `pwd`'

Also, you might want to consider asking questions related to repo
on the repo-discuss@googlegroups.com mailing list.  There's a lot
more repo users there than on the git mailing list, and they have
started to come up with their own "tips n tricks".

-- 
Shawn.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Questions about repo and git submodule
  2008-12-23 15:29 ` Shawn O. Pearce
@ 2008-12-25  6:28   ` Emily Ren
  2008-12-27 17:45     ` Shawn O. Pearce
  0 siblings, 1 reply; 4+ messages in thread
From: Emily Ren @ 2008-12-25  6:28 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Git Mailinglist

Hi Shawn,

Merry Christmas !

Thank you for your guide ! I've created git repository with submodules
with a simple script successfully.

Now I have another question,  since my android repo will always sync
up from android.git.kernel.org, my git repository needs to be updated
accordingly.  Is there a tool I can use to sync up from repo to git
repositoy ?

Thanks,
Emily

On Tue, Dec 23, 2008 at 11:29 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Emily Ren <lingyan.ren@gmail.com> wrote:
>>
>> I have some questions about android repo and git submodule.
>>
>> I created a repo repository with below commands:
>> 1.  repo init -u git://android.git.kernel.org/platform/manifest.git
>> 2.  repo initialized in /android
>>
>> 1. The android dir is not a git repository,
>
> Correct, it is not a git repository.  The repo tool does not use
> git submodules.  The top level of a repo client has a ".repo/"
> directory with metadata, not a ".git/" directory.  The table of
> contents (the subprojects) is stored in XML files under ".repo/".
>
> <aside>
> I actually fought against the XML format for repo's manifest, but
> others felt it was suitable.  And then walked away from the project
> after Android open-sourced its code tree.  Leaving me to maintain it.
> I see a file format simplification in the future for repo.
> </aside>
>
>> if other people clone my
>> android code, how does it work?
>
> Sadly this isn't supported correctly.  You can't initialize one
> repo client from another, even though you can git clone one git
> repository from any other.  Its a bug in repo's design.  The data
> under ".repo/projects/" isn't laid out correctly to permit reuse
> of one repo client to initialize another.
>
> Its something I keep meaning to fix, but its going to take some
> real effort.
>
> In the mean time, there is a "--mirror" flag to repo init
> which can be used to clone everything into bare repositories.
> Those bare repositories can be published for others to repo init
> from, though you need to customize the manifest.git:default.xml
> so that the embedded URL refers back to your server and not
> android.git.kernel.org.  Yet another thing I want to fix.
>
>> 2. I want to make android dir to be a git repository, is it workable
>> that I create submodule for each subdirectory in another directory? Is
>> there a script for it?
>
> You might be able to do something like this:
>
>        cd /android
>        git init
>        repo forall -c 'cd /android && git submodule add `pwd`'
>
> Also, you might want to consider asking questions related to repo
> on the repo-discuss@googlegroups.com mailing list.  There's a lot
> more repo users there than on the git mailing list, and they have
> started to come up with their own "tips n tricks".
>
> --
> Shawn.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Questions about repo and git submodule
  2008-12-25  6:28   ` Emily Ren
@ 2008-12-27 17:45     ` Shawn O. Pearce
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn O. Pearce @ 2008-12-27 17:45 UTC (permalink / raw)
  To: Emily Ren; +Cc: Git Mailinglist

Emily Ren <lingyan.ren@gmail.com> wrote:
> Thank you for your guide ! I've created git repository with submodules
> with a simple script successfully.
> 
> Now I have another question,  since my android repo will always sync
> up from android.git.kernel.org, my git repository needs to be updated
> accordingly.  Is there a tool I can use to sync up from repo to git
> repositoy ?

I think this discussion has moved to the repo-discuss list:

  https://groups.google.com/group/repo-discuss/browse_thread/thread/2fa368ed7cac5d79

-- 
Shawn.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-27 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-23 14:01 Questions about repo and git submodule Emily Ren
2008-12-23 15:29 ` Shawn O. Pearce
2008-12-25  6:28   ` Emily Ren
2008-12-27 17:45     ` Shawn O. Pearce

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).