Re: [PATCH 2/2] Allow passing pipes for input pipes to diff --no-index
- From
Jeff King <peff@peff.net>
- Date
- Sep 21, 2020, 19:31 UTC
- Message-ID
- <20200921193120.GB2399334@coredump.intra.peff.net>
- In-Reply-To
- <f338b63f-fd89-095c-b036-8d548fd2470c@gmail.com>
On Sun, Sep 20, 2020 at 08:54:53AM -0400, Thomas Guyot wrote:
Show 9 quoted lines
> Considering the issue with MacOS I'm starting to think the best solution > is to not use any heuristic and read passed-in files directly. That > said, I don't think it makes much change either way (if I resurrect > Brian's patch is will probably end up being a hybrid between the two as > both read the pipe at the same place and my approach was simpler further > down). > > I'm not sure which way I prefer to start first - will you accept a patch > that reads passed in files as-is if I I start with this one?
I think the ideal is:
- implement a command-line option to read the content of paths on the
command-line literally (i.e., reading from pipes, dereferencing
symlinks, etc) - make sure we have the inverse option (which you should get for free
in step 1 if you use parse_options)- flip the default to do literal reads
We'd sometimes wait several versions before that last step to give people time to adjust scripts, etc. But in this case, I suspect it would be OK to just flip it immediately. We don't consider "git diff" itself part of the stable plumbing, and the --no-index part of it I would consider even less stable. And AFAICT most people consider the current behavior a bug because it doesn't behave like other diff tools.
-Peff