git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: js/difftool-no-index, was Re: What's cooking in git.git (May 2019, #02; Tue, 14)
Date: Wed, 15 May 2019 17:50:28 +0900	[thread overview]
Message-ID: <xmqqsgtg5cff.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1905151015540.44@tvgsbejvaqbjf.bet> (Johannes Schindelin's message of "Wed, 15 May 2019 10:24:40 +0200 (DST)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> 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 -) <version1.tar
    $ (cd /var/tmp/2 && tar xvf -) <version2.tar
    $ git difftool --dir-diff --no-index /var/tmp/1 /var/tmp/2

isn't that what the user wanted to do?

Obviously "git difftool --dir-diff --no-index" can be replaced with
the underlying comparison tool that "difftool--helper" would have
chosen by the end user, so it is not the end of the world if we do
not to support the combination and error it out instead, like your
patch does.  But I just thought it would be nicer to the end users
who extracted two tarballs into a pair of pristine directories and
wanted to compare them in a way familiar to them.

  reply	other threads:[~2019-05-15  8:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13 16:11 What's cooking in git.git (May 2019, #02; Tue, 14) Junio C Hamano
2019-05-13 22:20 ` Elijah Newren
2019-05-14  9:54 ` js/difftool-no-index, was " Johannes Schindelin
2019-05-15  1:28   ` Junio C Hamano
2019-05-15  8:24     ` Johannes Schindelin
2019-05-15  8:50       ` Junio C Hamano [this message]
2019-05-17 18:27         ` Johannes Schindelin
2019-05-19  1:44           ` Junio C Hamano
2019-05-21 22:28             ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqsgtg5cff.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).