Re: [PATCH 1/2] add: warn when adding an embedded repository

2017-06-15 Thread Jeff King
On Wed, Jun 14, 2017 at 10:53:12AM -0700, Stefan Beller wrote: > >> In my ideal dream world of submodules we would have the following: > >> > >> $ cat .gitmodules > >> [submodule "sub42"] > >> path = foo > >> # path only in tree! > > > > TBH, I am not sure why we need "path"; couldn't

Re: [PATCH 1/2] add: warn when adding an embedded repository

2017-06-14 Thread Stefan Beller
On Tue, Jun 13, 2017 at 11:36 PM, Jeff King wrote: > On Tue, Jun 13, 2017 at 10:07:43AM -0700, Stefan Beller wrote: > >> > I also waffled on whether we should ask the submodule code >> > whether it knows about a particular path. Technically: >> > >> > git config

Re: [PATCH 1/2] add: warn when adding an embedded repository

2017-06-14 Thread Jeff King
On Tue, Jun 13, 2017 at 10:16:15AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > I also waffled on whether we should ask the submodule code > > whether it knows about a particular path. Technically: > > > > git config submodule.foo.path foo > > git config

Re: [PATCH 1/2] add: warn when adding an embedded repository

2017-06-14 Thread Jeff King
On Tue, Jun 13, 2017 at 10:07:43AM -0700, Stefan Beller wrote: > > I also waffled on whether we should ask the submodule code > > whether it knows about a particular path. Technically: > > > > git config submodule.foo.path foo > > git config submodule.foo.url git://... > > git add foo > > >

Re: [PATCH 1/2] add: warn when adding an embedded repository

2017-06-13 Thread Junio C Hamano
Jeff King writes: > I also waffled on whether we should ask the submodule code > whether it knows about a particular path. Technically: > > git config submodule.foo.path foo > git config submodule.foo.url git://... > git add foo > > is legal, but would still warn with this

Re: [PATCH 1/2] add: warn when adding an embedded repository

2017-06-13 Thread Brandon Williams
On 06/13, Stefan Beller wrote: > On Tue, Jun 13, 2017 at 2:24 AM, Jeff King wrote: > > > There is a config knob that can disable the (long) hint. But > > I intentionally omitted a config knob to disable the warning > > entirely. Whether the warning is sensible or not is > >

Re: [PATCH 1/2] add: warn when adding an embedded repository

2017-06-13 Thread Stefan Beller
On Tue, Jun 13, 2017 at 2:24 AM, Jeff King wrote: > It's an easy mistake to add a repository inside another > repository, like: > > git clone $url > git add . > > The resulting entry is a gitlink, but there's no matching > .gitmodules entry. Trying to use "submodule init" (or

[PATCH 1/2] add: warn when adding an embedded repository

2017-06-13 Thread Jeff King
It's an easy mistake to add a repository inside another repository, like: git clone $url git add . The resulting entry is a gitlink, but there's no matching .gitmodules entry. Trying to use "submodule init" (or clone with --recursive) doesn't do anything useful. Prior to v2.13, such an entry