git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH 0/2] git diff <(command1) <(command2)

From
Jacob Keller <jacob.keller@gmail.com>
Date
Nov 11, 2016, 23:15 UTC
Message-ID
<CA+P7+xr4xOhHJdL=1GbTrRXq_sdco7VYAq+arqw3Kc2gFvbO7w@mail.gmail.com>
In-Reply-To
<20161111201958.2175-1-dennis@kaarsemaker.net>

On Fri, Nov 11, 2016 at 12:19 PM, Dennis Kaarsemaker <dennis@kaarsemaker.net> wrote:

Show 12 quoted lines
> 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.
>

I think this is really useful. I have an alias so that "diff" is just git diff --no-index. It's really useful, because I find the output of git-diff to be much better. Not being able to diff from pipes or symlinks is something I've run into before and it's annoying. So I could really use this.

Thanks, Jake

Show 16 quoted lines
> 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
>
Previous: Jeff King
Message 18 of 18 in “git diff <(command1) <(command2)”
  1. 0/2 git diff <(command1) <(command2)Dennis Kaarsemaker, Nov 11, 2016
  2. 2/2 diff --no-index: support reading from pipesDennis Kaarsemaker, Nov 11, 2016
  3. 1/2 diff --no-index: add option to follow symlinksDennis Kaarsemaker, Nov 11, 2016
  4. Junio C HamanoNov 11, 2016
  5. Jacob KellerNov 11, 2016
  6. Johannes SchindelinNov 12, 2016
  7. Junio C HamanoNov 14, 2016
  8. Michael J GruberNov 14, 2016
  9. Johannes SchindelinNov 14, 2016
  10. Junio C HamanoNov 14, 2016
  11. Michael J GruberNov 14, 2016
  12. Junio C HamanoNov 14, 2016
  13. Johannes SchindelinNov 16, 2016
  14. Junio C HamanoNov 16, 2016
  15. Junio C HamanoNov 16, 2016
  16. Dennis KaarsemakerNov 12, 2016
  17. Jeff KingNov 12, 2016
  18. Jacob KellerNov 11, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.