Re: [PATCH v10 0/9] submodule inline diff format
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 25, 2016, 22:38 UTC
- Message-ID
- <xmqqr39cjwxx.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CA+P7+xrQy33gt8bnsagLVPAHhZPZx-3s0E_Aj7tOwXnHjOoCBg@mail.gmail.com>
Jacob Keller <jacob.keller@gmail.com> writes:
Show 5 quoted lines
> So we should support the gitlink to a repository stored at <path> > without stuff inside the .git/modules, and we should support submodule > gitlinks with a proper .gitmodules setup. I don't think we should > die() but we should error properly so I will introduce a _gently() > variant of these functions, and die properly in the regular flow.
Because "git diff [--cached] [<tree-ish>]" in the top-level is driven by a gitlink in the index, immediately after adding a new submodule to the index but before describing it in .gitmodules you might not have a name (and you know in that case the path will become the name when adding it to .gitmodules). Also a gitlink in the index may correspond to a submodule the user of the top-level is not interested in, so there may not be anything in .git/modules/ that corresponds to it. In these cases, I suspect that you do not want to die, but you can just tell the user "I do not have enough information to tell you a useful story yet".