Re: [PATCH v4] diff: do not show submodule with untracked files as "-dirty"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 23, 2020, 20:22 UTC
- Message-ID
- <xmqqtuukg0a9.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAHjREB5Uye1b=bVZsAc1WPcrWrqxnrMZxBtLT345CrpU7gTpVg@mail.gmail.com>
Sangeeta NB <sangunb09@gmail.com> writes:
Show 15 quoted lines
>> By the way, in builtin/describe.c there is an invocation of
>> "diff-index" without any --ignore-submodules=<what> option.
>>
>> /* diff-index command arguments to check if working tree is dirty. */
>> static const char *diff_index_args[] = {
>> "diff-index", "--quiet", "HEAD", "--", NULL
>> };
>>
>> Would the behaviour of diff-index invocation in "git describe --dirty"
>> affected by the change of the default in any way?
>
> I don't think so because describe was already behaving in the way that
> we won't. We changed the behavior of git diff to match it with that.
> So it doesn't make sense to add anything to that. Tell me if I am
> missing something.How does "describe" see if the working tree is dirty? What mechanism does it use? Doesn't it run the "diff-index" command internally?
And with this patch, aren't you changing the default behaviour of "diff" family of commands by touching repo_diff_setup() function? How does it not affect the behaviour of the "diff-index" command, hence the input "git describe" uses to formulate its output?