On Tue, Aug 9, 2016 at 10:54 AM, Junio C Hamano <gits...@pobox.com> wrote:
> Junio C Hamano <gits...@pobox.com> writes:
>> If I am reading the implementation of real_path_internal()
>> correctly, the most relevant reason that an "if-able" repository
>> cannot be used causes real_path_if_valid() to return NULL.
> Oops, too many proofreading and rephrasing. Please insert "I do not
> think that" before "the most relevant".
It took me a while to mentally process and reread this.
It would have been easier with just
s/the most relevant reason/I do not think that the most relevant reason/
but that is just me being used to s/ expressions by now.
I think our emails nearly crossed. In the other thread I wondered if
you had different expectations on the -if-able part than I do.
For the expected use case I do expect that the missing path is the
most relevant thing (the submodule is not checked out).
Of course the submodule may be cloned shallow as it was recommended
in the .gitmodules file, so we should also care about that use case.
> Let's say your superproject borrows from ~/w/super, whose submodule
> repositories (if cloned) are directly in "~/w/super/.git/modules/".
> When you clone a submodule X for your superproject, you allow it to
> borrow from "~/w/super/.git/modules/X" if there is one available.
which is why we need to pass in ..../X/ with an ending slash.
See the comment in 8/9.
+ * We need to end the new path with '/' to mark it as a dir,
+ * otherwise a submodule name containing '/' will be broken
+ * as the last part of a missing submodule reference would
+ * be taken as a file name.
+ strbuf_addf(&sb, "modules/%s/", sas->submodule_name);
Thinking about that we may want to not rely on such a hack,
but make it clearer.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html