justinvh / gitpaste

DEPRECATED - GitPaste is a clone of GitHub's Gist.
Other
184 stars 49 forks source link

Always use --color=never with git-diff #21

Closed knutwalker closed 12 years ago

knutwalker commented 12 years ago

It is possible to configured git to always execute git-diff with colorization and since the diff is rendered by letting Pygments highlight the output of git-diff, the colorizing characters, meant for the output on a tty, are included in the result. (Use somthing like git config --global color.diff always , see the git book for a better explanation) This leads to something like the following:

[1mdiff --git a/sqp.json b/sqp.json
index 593d8c1..7d45b9f 100644
[1m--- a/sqp.json
[1m+++ b/sqp.json
[36m@@ -1,6 +1,6 @@
 {

The pull request enforces git to never use its own colorization.