Re: js/difftool-no-index, was Re: What's cooking in git.git (May 2019, #02; Tue, 14)
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 15, 2019, 08:24 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1905151015540.44@tvgsbejvaqbjf.bet>
- In-Reply-To
- <xmqqef508q0y.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Wed, 15 May 2019, Junio C Hamano wrote:
Show 19 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > On Tue, 14 May 2019, Junio C Hamano wrote: > > > >> * js/difftool-no-index (2019-05-09) 1 commit > >> - difftool --no-index: error out on --dir-diff (and don't crash) > >> > >> The "--dir-diff" mode of "git difftool" is not useful in "--no-index" > >> mode; they are now explicitly marked as mutually incompatible. > >> > >> Will merge to 'next'. > > > > Seeing as the following is a part of v2.22.0-rc0's release notes: > > > > * "git difftool" can now run outside a repository. > > > > maybe we could get this to `master` instead of `next`? > > There is no 'instead of'. Topics advance one step at a time.
Well, some topics seem to enter `next` via `master`...
Show 6 quoted lines
> I do not recall seeing you respond to my review comments on the > "error out" patch <xmqqv9ykdr1w.fsf@gitster-ct.c.googlers.com>, but > thinking about it further, assuming that my rephrasing of your > justification in my review was correct, I wonder if it is even more > correct if we do not error out but simply behave as if "--dir-diff" > option were not given.
I misunderstood that to be a rhetoric question, like in the "thinking out loud" you favor. Sorry.
Show 6 quoted lines
> That is, if there were some way to distinguish tracked and untracked > paths in --no-index mode, --dir-diff would copy only the tracked parts > to temporary directories and run tree comparison. Since there is no > "untracked paths" by definition in --no-index mode, we do not even > have to make copies but just compare the two directories given using > the same tree comparison tool.
As far as `--no-index` is concerned, all files are untracked anyway. There is no index, so there are no staged/committed/tracked files.
> Wouldn't that be more useful behaviour than telling the end users to > run the backend tree comparison tool themselves?
I am lost. What behavior are you talking about? I *think* you mean to say that the `--dir-diff` mode under `--no-index` should essentially do what `--no-dir-diff` does? I think that's not the way I want to go. The `--dir-diff` mode only makes sense when there is a mix of tracked/untracked files, which simply is not the case for `--no-index`. And we should not make it "fall back" to its opposite. The user asked for `--dir-diff` and it just does not make sense.
In any case, the patch series I'd like to see advanced to `master` is not about supporting or not supporting `--dir-diff` with `--no-index`, but about preventing a segmentation fault when a user calls the (non-sense) combination of `--no-index` and `--dir-diff`.
Ciao, Dscho