Re: [PATCH v3 7/7] submodule: support reading .gitmodules even when it's not checked out

2018-08-23 Thread Antonio Ospite
On Wed, 22 Aug 2018 08:29:25 -0700 Junio C Hamano wrote: > Antonio Ospite writes: > [...] > >> > > + else if (get_oid(GITMODULES_HEAD, ) >= 0) > >> > > + config_source.blob = GITMODULES_HEAD; > >> > > >> Would using ":.gitmodules" instead of

Re: [PATCH v3 7/7] submodule: support reading .gitmodules even when it's not checked out

2018-08-22 Thread Junio C Hamano
Antonio Ospite writes: > Maybe "submodule--helper config --check-writeable" could be a better > name to avoid confusion between the boolean return value of the C > function (0: false, 1: true) and the exit status returned to the shell > (0: safe to write, !0: unsafe). Perhaps. The main point

Re: [PATCH v3 7/7] submodule: support reading .gitmodules even when it's not checked out

2018-08-22 Thread Antonio Ospite
On Mon, 20 Aug 2018 23:37:55 +0200 Antonio Ospite wrote: > On Tue, 14 Aug 2018 13:36:17 -0700 > Junio C Hamano wrote: > > > Antonio Ospite writes: [...] > > > > > > + # For more details about this check, see > > > + # builtin/submodule--helper.c::module_config() > > > + if test ! -e

Re: [PATCH v3 7/7] submodule: support reading .gitmodules even when it's not checked out

2018-08-20 Thread Antonio Ospite
On Tue, 14 Aug 2018 13:36:17 -0700 Junio C Hamano wrote: > Antonio Ospite writes: > > > /* Equivalent to ACTION_SET in builtin/config.c */ > > - if (argc == 3) > > + if (argc == 3) { > > + struct object_id oid; > > + > > + /* > > +* If the .gitmodules

Re: [PATCH v3 7/7] submodule: support reading .gitmodules even when it's not checked out

2018-08-14 Thread Junio C Hamano
Antonio Ospite writes: > /* Equivalent to ACTION_SET in builtin/config.c */ > - if (argc == 3) > + if (argc == 3) { > + struct object_id oid; > + > + /* > + * If the .gitmodules file is not in the working tree but it > + * is in the

Re: [PATCH v3 7/7] submodule: support reading .gitmodules even when it's not checked out

2018-08-14 Thread Brandon Williams
On 08/14, Antonio Ospite wrote: > When the .gitmodules file is not available in the working tree, try > using HEAD:.gitmodules from the current branch. This covers the case > when the file is part of the repository but for some reason it is not > checked out, for example because of a sparse

[PATCH v3 7/7] submodule: support reading .gitmodules even when it's not checked out

2018-08-14 Thread Antonio Ospite
When the .gitmodules file is not available in the working tree, try using HEAD:.gitmodules from the current branch. This covers the case when the file is part of the repository but for some reason it is not checked out, for example because of a sparse checkout. This makes it possible to use at