From: Junio C Hamano Date: Fri, 23 Oct 2020 20:22:38 GMT Subject: Re: [PATCH v4] diff: do not show submodule with untracked files as "-dirty" Message-ID: In-Reply-To: Sangeeta NB writes: >> By the way, in builtin/describe.c there is an invocation of >> "diff-index" without any --ignore-submodules= 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?