git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Suggestion: git clone should warn if repository has submodules
@ 2019-08-06 14:03 Jason Sewall
  2019-08-06 15:54 ` Mateusz Loskot
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Sewall @ 2019-08-06 14:03 UTC (permalink / raw)
  To: git

Submodules are great, and I used them at work. The problem is, people
wind up cloning my repos without --recursive and then nothing works
for them, because  the submodules weren't populated and those
ultimately are needed to build my code.

I can see why --recursive isn't the default for git clone; you don't
want to just blindly follow whatever urls are in .gitmodules without
the user being aware of the possibility. That said, folks that are not
familiar with submodules (which seems to be most of the people I work
with!) wind up confused by this and don't know how to fix it.

While the burden is on the user and should remain so, it seems like
having git print out a message after cloning to the effect of "there
are submodules that are not populated, maybe you should look at them"
would go a long way to eliminating confusion for newer users. Yes, I
have put some documentation in my project that users should fetch the
submodules, but if possible, I'd like lower the number of times I have
to suggest that people RTFM.

Alternatively, is it preferable that I have my build system look at
the submodules and inform the user more helpfully? I'm curious to know
what, if any, is the recommended procedure.

Cheers,
Jason

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

* Re: Suggestion: git clone should warn if repository has submodules
  2019-08-06 14:03 Suggestion: git clone should warn if repository has submodules Jason Sewall
@ 2019-08-06 15:54 ` Mateusz Loskot
  2019-08-06 15:58   ` Michal Suchánek
  0 siblings, 1 reply; 3+ messages in thread
From: Mateusz Loskot @ 2019-08-06 15:54 UTC (permalink / raw)
  To: git

On Tue, 6 Aug 2019 at 16:04, Jason Sewall <jasonsewall@gmail.com> wrote:
>
> Submodules are great, and I used them at work. The problem is, people
> wind up cloning my repos without --recursive and then nothing works
> for them, because  the submodules weren't populated and those
> ultimately are needed to build my code.

What you need is a simple document for your team that outlines the common
Git workflow or README.md in root directory of your repositories with
fat heading:

## Clone

```
git clone --recursive ...
```


A team in another company may require non-recursive clones by default
and warnings from git may be quite annoying. Given the fact there is not
one but may valid "my way"-s available, acceptable and supported by Git,
I think, babysitting behaviour is not quite aligned with its philosophy, is it?

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

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

* Re: Suggestion: git clone should warn if repository has submodules
  2019-08-06 15:54 ` Mateusz Loskot
@ 2019-08-06 15:58   ` Michal Suchánek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Suchánek @ 2019-08-06 15:58 UTC (permalink / raw)
  To: Mateusz Loskot; +Cc: git

On Tue, 6 Aug 2019 17:54:20 +0200
Mateusz Loskot <mateusz@loskot.net> wrote:

> On Tue, 6 Aug 2019 at 16:04, Jason Sewall <jasonsewall@gmail.com> wrote:
> >
> > Submodules are great, and I used them at work. The problem is, people
> > wind up cloning my repos without --recursive and then nothing works
> > for them, because  the submodules weren't populated and those
> > ultimately are needed to build my code.  
> 
> What you need is a simple document for your team that outlines the common
> Git workflow or README.md in root directory of your repositories with
> fat heading:
> 
> ## Clone
> 
> ```
> git clone --recursive ...
> ```
> 
> 
> A team in another company may require non-recursive clones by default
> and warnings from git may be quite annoying. Given the fact there is not
> one but may valid "my way"-s available, acceptable and supported by Git,
> I think, babysitting behaviour is not quite aligned with its philosophy, is it?

It has warnings that you can disable globally or per-repository in
configuration to fit your workflow.

Thanks

Michal

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

end of thread, other threads:[~2019-08-06 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 14:03 Suggestion: git clone should warn if repository has submodules Jason Sewall
2019-08-06 15:54 ` Mateusz Loskot
2019-08-06 15:58   ` Michal Suchánek

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).