Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only colorize output when stdout is a tty. #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

acg
Copy link

@acg acg commented Feb 23, 2018

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.

@dbosk
Copy link

dbosk commented Jun 15, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants