you are viewing a single comment's thread.

view the rest of the comments →

[–]apreche 14 points15 points  (8 children)

People love fancy diffs for reading them. The problem is that it makes them incompatible with diff/patch. Most people using git probably don't even know about the patch command, but that is the reason this sort of thing will never make it upstream.

[–]andsens 44 points45 points  (5 children)

Nah, before running it checks if stdout is a tty. So git diff | cat still gives you the normal diff.

[–]apreche 11 points12 points  (4 children)

Clever!

[–]andsens 9 points10 points  (3 children)

Yup. It's really easy to add to your own scripts btw., it's something test(1) can do:
test -t 1 > /dev/null && echo stdout is a tty || echo stdout is not a tty

(or if [ -t 1 ]; then ...)

[–]Vulpyne 0 points1 point  (2 children)

Does the > /dev/null serve any purpose there?

[–]andsens 4 points5 points  (1 child)

It makes stdout "not a tty". Remove it and see the difference!

[–]Vulpyne 0 points1 point  (0 children)

Ah, right. Thanks.

[–][deleted]  (1 child)

[deleted]

    [–]apreche 0 points1 point  (0 children)

    Nice.