git-diff-blame icon indicating copy to clipboard operation
git-diff-blame copied to clipboard

Only colorize output when stdout is a tty.

Open acg opened this issue 7 years ago • 2 comments

This makes the output suitable for programmatic consumption. In my case, I was interested in what commits didn't contribute to a given branch's diff, so I tried a git-diff-blame master | grep '^ [-+]'. This didn't work but I couldn't see why -- then I noticed the ANSI escape sequences weren't matching ^ .

Anyway thanks for git-diff-blame! Exactly what I was looking for.

acg avatar Feb 23 '18 03:02 acg

Doesn't this break git diff-blame | less -r? I like the suggestion, but then diff-blame should automatically page (using e.g. less -r) in a TTY.

dbosk avatar Jun 15 '21 13:06 dbosk