Re: [PATCHv2 0/6] git clone: Marry --recursive and --reference
- From
Stefan Beller <sbeller@google.com>
- Date
- Aug 9, 2016, 17:26 UTC
- Message-ID
- <CAGZ79kZKTV5PCAR41O1t1c_y6N18u6gsoWozOfr=EPHic-7wYw@mail.gmail.com>
- In-Reply-To
- <xmqqk2fqc583.fsf@gitster.mtv.corp.google.com>
On Tue, Aug 9, 2016 at 8:49 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> Stefan Beller <sbeller@google.com> writes: > >> v3: >> >> Thanks to Junios critial questions regarding the design, I took a step back >> to look at the bigger picture. >> >> --super-reference sounds confusing. (what is the super referring to?) >> So drop that approach. >> >> Instead we'll compute where the reference might be in the superproject scope >> and ask the submodule clone operation to consider an optional reference. >> If the referenced alternate is not there, we'll just warn about it and >> carry on. > > I like the general direction, but I hope that the warning comes only > when the user said "--reference" on the command line (i.e. "you > asked me to use reference, but for this submodule I couldn't find a > usable one").
No it comes all the time now, as there is no difference between "clone --recursive" and later running "submodule update" manually.
Assume a new submodule is added and you forget to update your main alternate all your other clones are borrowing from. If there is no warning you create a real clone for the new submodule all the time, which is what you wanted to avoid in the first place?
Show 9 quoted lines
> If the implementation allows the same mechanism to > help later "submodule init && submodule update" borrow from the > submodule repositories of the superproject the current superproject > borrows from (i.e. no explicit "--reference" on the command line > when doing init/update), I would think the case that needs warning > is "you didn't explicitly ask me to borrow objects, but I found one > we could, so I did it anyway without being asked", and it is not a > warning-worthy condition if we didn't find a cloned submodule in the > repository our superproject borrows from.
"you did ask me to use alternates once and for all when setting up the superproject: now for this added submodule I don't find the alternate; That is strange?"
Thanks, Stefan