git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
From: Dennis Kaarsemaker <dennis@kaarsemaker.net>
To: git@vger.kernel.org
Cc: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Subject: [RFC/PATCH 0/2] git diff <(command1) <(command2)
Date: Fri, 11 Nov 2016 21:19:56 +0100
Message-ID: <20161111201958.2175-1-dennis@kaarsemaker.net> (raw)

Today on #git, a user asked why git diff <(command1) <(command2) gave only some
gibberish about pipes as output. The answer is fairly simple: git diff gets as
arguments /dev/fd/62 and /dev/fd/63, which are symlinks. So git simply
readlink()s them and gets pipe:[123456] as destination of that link which it
then outputs.

Given that 'normal' diff provides arguably better output in this case (a diff
of the output of the two commands), I wanted to look at what it would take for
git to handle this. Surprisingly: not much. 1/2 adds support for
--follow-symlinks to git diff --no-index (and only the --no-index variant) and
2/2 adds support for reading from pipes.

No tests or documentation updates yet, and I'm not sure whether
--follow-symlinks in other modes than --no-index should be supported, ignored
(as it is now) or cause an error, but I'm leaning towards the third option.

Dennis Kaarsemaker (2):
  diff --no-index: add option to follow symlinks
  diff --no-index: support reading from pipes

 diff-no-index.c | 15 ++++++++++++---
 diff.c          | 23 +++++++++++++++++++----
 diff.h          |  2 +-
 3 files changed, 32 insertions(+), 8 deletions(-)

-- 
2.10.1-449-gab0f84c


             reply index

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 20:19 Dennis Kaarsemaker [this message]
2016-11-11 20:19 ` [PATCH 1/2] diff --no-index: add option to follow symlinks Dennis Kaarsemaker
2016-11-11 20:19 ` [PATCH 2/2] diff --no-index: support reading from pipes Dennis Kaarsemaker
2016-11-11 21:27 ` [RFC/PATCH 0/2] git diff <(command1) <(command2) Junio C Hamano
2016-11-11 23:14   ` Jacob Keller
2016-11-12 10:08     ` Johannes Schindelin
2016-11-14  3:14       ` Junio C Hamano
2016-11-14 15:31       ` Michael J Gruber
2016-11-14 16:40         ` Johannes Schindelin
2016-11-14 18:01         ` Junio C Hamano
2016-11-14 20:23           ` Michael J Gruber
2016-11-14 21:10             ` Junio C Hamano
2016-11-16  9:50               ` Johannes Schindelin
2016-11-16 18:29                 ` Junio C Hamano
2016-11-16 18:37                   ` Junio C Hamano
2016-11-12  6:11   ` Dennis Kaarsemaker
2016-11-12  7:06     ` Jeff King
2016-11-11 23:15 ` Jacob Keller

Reply instructions:

You may reply publically 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=20161111201958.2175-1-dennis@kaarsemaker.net \
    --to=dennis@kaarsemaker.net \
    --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

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror http://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox