From: Junio C Hamano Date: Wed, 15 May 2019 08:50:28 GMT Subject: Re: js/difftool-no-index, was Re: What's cooking in git.git (May 2019, #02; Tue, 14) Message-ID: In-Reply-To: Johannes Schindelin writes: > As far as `--no-index` is concerned, all files are untracked anyway. There > is no index, so there are no staged/committed/tracked files. > ... Ah, I see I completely misspoke; sorry, there should be no "pretend as if there were no --dir-diff". In the normal usage, "difftool --dir-diff" materializes the two tree-shaped things (I am using an invented term loosely here---it may be a tree-ish, or what is in the index, or the working tree files) in two temporary directories and runs a tool to compare two directories, and what is copied out of the working tree is limited to the tracked ones (for the obvious purpose to avoid showing them the the directory comparison tool). Extending that semantics literally to "--no-index" use would result in nonsense. As you say, there is no "tracked" thing under the mode, so doing what "--dir-diff" literally does (i.e. only copy out what is tracked for the purpose of comparison) would be to compare nothing against nothing. That is not useful. What I was wondering when I wrote the message you are responding to was complete opposite. I was imagining what would happen if we treat _everything_ in the two directories being compared by "difftool --dir-diff --no-index" as if it is tracked. We do not even have to make copies (as we are not doing a selective "only the tracked ones" copy), but if it is easier to implement we could make redundant copies. In either case, the two directories given to the "difftool --no-index" would be compared with the same directory comparison tool the end user is used to (as that is the one the "--dir-diff" mode uses to compare without "--no-index"). When the end user does this sequence, for example: $ rm -fr /var/tmp/1 /var/tmp/2 && mkdir /var/tmp/1 /var/tmp/2 $ (cd /var/tmp/1 && tar xvf -)