All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH v2 0/2] "diff --no-index" updates
Date: Wed, 25 Mar 2015 23:20:30 -0700	[thread overview]
Message-ID: <1427350832-17005-1-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <xmqqiodtd3b4.fsf@gitster.dls.corp.google.com>

Here are a few patches to scratch my itches in "diff --no-index" I
have had for quite some time, but didn't feel strong enough to fix
them myself so far.

The first one is to make "diff File Directory" (and "diff Directory
File") more useful by aligning its behaviour with more mainstream
"diff" implementations.  We used to complain that one is a file and
the other is a directory and died without doing anything useful.
Instead, we pretend as if the user asked to compare "diff File
Directory/File" (or vice versa), which is what GNU diff does.

The second one on the other hand is to make it behave more like the
normal "git diff" when comparing two directories, when one directory
has a path as a file while the other directory has the same path as
a directory.  GNU diff punts and says "File D1/path is a regular
file while file D2/path is a directory" in such a case, and that is
what "diff --no-index" does, too, but when the normal "git diff"
compares two such trees, we show a removal of the file and creations
of all the files in the directory (or vice versa).  With this patch,
we teach "diff --no-index" codepath to do the same, which would be
more in line with the spirit of "diff --no-index", which is to make
"git diff" goodies available to people who compare paths outside
control of any git repository.

Junio C Hamano (2):
  diff-no-index: DWIM "diff D F" into "diff D/F F"
  diff: align D/F handling of "diff --no-index" with that of normal Git

 diff-no-index.c          | 66 ++++++++++++++++++++++++++++++++++++++++++++++--
 t/t4053-diff-no-index.sh | 34 +++++++++++++++++++++++++
 2 files changed, 98 insertions(+), 2 deletions(-)

-- 
2.3.4-475-g3180e2e

  parent reply	other threads:[~2015-03-26  6:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-22  5:11 [RFC/PATCH] align D/F handling of "diff --no-index" with that of normal Git Junio C Hamano
2015-03-22  7:01 ` Eric Sunshine
2015-03-22 12:37 ` Ramsay Jones
2015-03-22 17:56   ` Junio C Hamano
2015-03-26  6:20 ` Junio C Hamano [this message]
2015-03-26  6:20   ` [PATCH v2 1/2] diff-no-index: DWIM "diff D F" into "diff D/F F" Junio C Hamano
2015-03-26  6:20   ` [PATCH v2 2/2] diff: align D/F handling of "diff --no-index" with that of normal Git Junio C Hamano

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

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

  git send-email \
    --in-reply-to=1427350832-17005-1-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.