Why does git diff
not work with process substitution?
$ echo hallo > hallo
$ echo holla > holla
$ git diff hallo holla # works
$ git diff hallo <(cat holla) # works not
diff --git a/hallo b/hallo
deleted file mode 100644
index 4cf5aa5..0000000
--- a/hallo
+++ /dev/null
@@ -1 +0,0 @@
-hallo
diff --git a/dev/fd/63 b/dev/fd/63
new file mode 120000
index 0000000..864a6ca`
Same with git diff --no-index
.
It works with plain diff
. cat
is only a trivial example, can be replaced by a non-trivial sed
expression.
Workaround:
$ cat holla | git diff hallo - # works
But it will not work if both arguments should be affected by process substitution, like described in many examples for diff and process substitution.