{"thread":{"id":"35280","subject":"error when git-diff get pipe args","startedAt":"2013-11-05T00:03:28Z","lastAt":"2013-11-05T00:08:44Z","messageCount":2,"participants":["chunguang qu","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"230103","messageId":"CABk77Dj6RUaY9bBShiUJkZp0SdURCNR0SbpS3HFXdmeEAOMYow@mail.gmail.com","threadId":"35280","inReplyTo":null,"subject":"error when git-diff get pipe args","fromName":"chunguang qu","fromEmail":"quchunguang@gmail.com","sentAt":"2013-11-05T00:03:28Z","receivedAt":"2013-11-05T00:03:28Z","isPatch":false,"sender":{"key":"quchunguang@gmail.com","avatar":null},"body":"$ cat a\n111\nfdsf\n333\n$ cat b\n111\n222\n333\n$ git diff a b                             # OK\ndiff --git a/a b/b\nindex 768560b..641d574 100644\n--- a/a\n+++ b/b\n@@ -1,3 +1,3 @@\n 111\n-fdsf\n+222\n 333\n$ git diff <(cat a) <(cat b)          # ERROR: no result print out\ndiff --git a/dev/fd/63 b/dev/fd/62\nindex 311e262..554e9f4 120000\n--- a/dev/fd/63\n+++ b/dev/fd/62\n@@ -1 +1 @@\n-pipe:[729963]\n\\ No newline at end of file\n+pipe:[729965]\n\\ No newline at end of file\n\n# compare with diff\n$ diff -u a b                            # OK\n--- a 2013-11-05 00:18:17.394805923 +0800\n+++ b 2013-11-05 00:18:25.546805865 +0800\n@@ -1,3 +1,3 @@\n 111\n-fdsf\n+222\n 333\n$ diff -u <(cat a) <(cat b)         # OK: get result in same case\n--- /dev/fd/63 2013-11-05 01:02:59.706787117 +0800\n+++ /dev/fd/62 2013-11-05 01:02:59.706787117 +0800\n@@ -1,3 +1,3 @@\n 111\n-fdsf\n+222\n 333\n"},{"id":"230106","messageId":"20131105000843.GD183446@vauxhall.crustytoothpaste.net","threadId":"35280","inReplyTo":"CABk77Dj6RUaY9bBShiUJkZp0SdURCNR0SbpS3HFXdmeEAOMYow@mail.gmail.com","subject":"Re: error when git-diff get pipe args","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2013-11-05T00:08:44Z","receivedAt":"2013-11-05T00:08:44Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Tue, Nov 05, 2013 at 08:03:28AM +0800, chunguang qu wrote:\n> $ cat a\n> 111\n> fdsf\n> 333\n> $ cat b\n> 111\n> 222\n> 333\n> $ git diff a b                             # OK\n> diff --git a/a b/b\n> index 768560b..641d574 100644\n> --- a/a\n> +++ b/b\n> @@ -1,3 +1,3 @@\n>  111\n> -fdsf\n> +222\n>  333\n> $ git diff <(cat a) <(cat b)          # ERROR: no result print out\n> diff --git a/dev/fd/63 b/dev/fd/62\n> index 311e262..554e9f4 120000\n> --- a/dev/fd/63\n> +++ b/dev/fd/62\n> @@ -1 +1 @@\n> -pipe:[729963]\n> \\ No newline at end of file\n> +pipe:[729965]\n> \\ No newline at end of file\n\nThis is because git diff compares symlinks instead of dereferencing\nthem, as diff does.  On Linux, /dev/fd is a symlink to /proc/self/fd,\nand the items in that directory are all symlinks.\n\ngit diff is not generally intended to diff arbitrary files from\narbitrary locations.  For that, you want plain old diff, which works as\nyou expect.\n\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"}]}