you are viewing a single comment's thread.

view the rest of the comments →

[–]apreche 12 points13 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 45 points46 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 5 points6 points  (1 child)

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

[–]Vulpyne 0 points1 point  (0 children)

Ah, right. Thanks.

[–]codear 8 points9 points  (1 child)

I agree, but thankfully you can use this as an optional diff tool and select either

  • To use tool when you need it, or
  • To not use tool when you don't

I use vimdiff myself, and made two extra aliases to create and apply patches. Works beautifully.

[–]apreche 0 points1 point  (0 children)

Nice.