All of lore.kernel.org
 help / color / mirror / Atom feed
* Selectively clone Git submodules -- a useful feature?
@ 2015-06-18 20:55 Lars Schneider
  2015-06-19 19:08 ` Jens Lehmann
  2016-03-16 20:47 ` Stefan Beller
  0 siblings, 2 replies; 3+ messages in thread
From: Lars Schneider @ 2015-06-18 20:55 UTC (permalink / raw)
  To: git

Hi,

AFAIK Git has two ways to clone a repository with respect to submodules:

(1) Plain clone of just the repository itself:
git clone git://github.com/foo/bar.git

(2) Recursive clone of the repository including all its submodules:
git clone --recursive git://github.com/foo/bar.git

I am working on a big cross platform project and on certain platforms I don't need certain submodules. AFAIK there is no way to selectively clone only a subset of the submodules with the standard command line interface. I wonder if something like an exclude pattern for submodules would be of general interest. I imagine a call like this after a plain "clone" operation:

git submodule update --init --recursive --exclude 3rdParty/Windows/*

or even:

git clone --recursive --exclude 3rdParty/Windows/* git://github.com/foo/bar.git

Please let me know what you think.


Thanks,
Lars


PS: I posted this question already on the Google Git group here:
https://groups.google.com/forum/?fromgroups=#!topic/git-users/jyKsd45d2MA

I am sorry, but I discovered this mailing list afterwards and I am not sure which one is the appropriate one. Please advise.


---
https://larsxschneider.github.io/

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

* Re: Selectively clone Git submodules -- a useful feature?
  2015-06-18 20:55 Selectively clone Git submodules -- a useful feature? Lars Schneider
@ 2015-06-19 19:08 ` Jens Lehmann
  2016-03-16 20:47 ` Stefan Beller
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Lehmann @ 2015-06-19 19:08 UTC (permalink / raw)
  To: Lars Schneider, git

Am 18.06.2015 um 22:55 schrieb Lars Schneider:
> AFAIK Git has two ways to clone a repository with respect to submodules:
>
> (1) Plain clone of just the repository itself:
> git clone git://github.com/foo/bar.git
>
> (2) Recursive clone of the repository including all its submodules:
> git clone --recursive git://github.com/foo/bar.git
>
> I am working on a big cross platform project and on certain platforms I don't
 > need certain submodules. AFAIK there is no way to selectively clone only a
 > subset of the submodules with the standard command line interface. I wonder
> if something like an exclude pattern for submodules would be of general interest.
 > I imagine a call like this after a plain "clone" operation:
>
> git submodule update --init --recursive --exclude 3rdParty/Windows/*

Git already supports that use case: Just set the "submodule.<name>.update"
configuration to "none" for all submodules you aren't interested in and
"git submodule update" will always skip them.

You can also set this config option globally:

git config --global submodule.<name>.update=none

That'll set the default for all repositories of the logged in user on this
computer to not update submodule <name>.

> or even:
>
> git clone --recursive --exclude 3rdParty/Windows/* git://github.com/foo/bar.git

git clone will be influenced by the global setting. If you just want to
skip submodule <name> for a single clone you can do it like this:

   git -c submodule.<name>.update=none clone --recursive git://github.com/foo/bar.git

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

* Re: Selectively clone Git submodules -- a useful feature?
  2015-06-18 20:55 Selectively clone Git submodules -- a useful feature? Lars Schneider
  2015-06-19 19:08 ` Jens Lehmann
@ 2016-03-16 20:47 ` Stefan Beller
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Beller @ 2016-03-16 20:47 UTC (permalink / raw)
  To: Lars Schneider, Jens Lehmann; +Cc: git

On Thu, Jun 18, 2015 at 1:55 PM, Lars Schneider
<larsxschneider@gmail.com> wrote:
> Hi,

Hi,

sorry for a real late answer to this,

>
> AFAIK Git has two ways to clone a repository with respect to submodules:
>
> (1) Plain clone of just the repository itself:
> git clone git://github.com/foo/bar.git
>
> (2) Recursive clone of the repository including all its submodules:
> git clone --recursive git://github.com/foo/bar.git
>
> I am working on a big cross platform project and on certain platforms I don't need certain submodules. AFAIK there is no way to selectively clone only a subset of the submodules with the standard command line interface. I wonder if something like an exclude pattern for submodules would be of general interest. I imagine a call like this after a plain "clone" operation:
>
> git submodule update --init --recursive --exclude 3rdParty/Windows/*
>
> or even:
>
> git clone --recursive --exclude 3rdParty/Windows/* git://github.com/foo/bar.git
>
> Please let me know what you think.

I am looking forward for exactly that feature, I even proposed exactly this
(in form of RFC patches, see
http://thread.gmane.org/gmane.comp.version-control.git/281670)

I plan on reviving this soon. Did you solve this problem as Jens proposed
or are you still looking for a solution?

Thanks,
Stefan

>
>
> Thanks,
> Lars
>
>
> PS: I posted this question already on the Google Git group here:
> https://groups.google.com/forum/?fromgroups=#!topic/git-users/jyKsd45d2MA
>
> I am sorry, but I discovered this mailing list afterwards and I am not sure which one is the appropriate one. Please advise.
>
>
> ---
> https://larsxschneider.github.io/--
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-03-16 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-18 20:55 Selectively clone Git submodules -- a useful feature? Lars Schneider
2015-06-19 19:08 ` Jens Lehmann
2016-03-16 20:47 ` Stefan Beller

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.