I'm running pre-commit on gitlab, and I noticed that the diffs produced when --show-diff-on-failure is enabled do not respect --color=always.
It looks like a pretty easy fix: we just need to pass the --color setting to git diff. It supports the same "auto", "always", "never" settings as pre-commit.
git diff --color documentation.
code in question: https://github.com/pre-commit/pre-commit/blob/master/pre_commit/commands/run.py#L227
I'm running
pre-commiton gitlab, and I noticed that the diffs produced when--show-diff-on-failureis enabled do not respect--color=always.It looks like a pretty easy fix: we just need to pass the
--colorsetting togit diff. It supports the same "auto", "always", "never" settings aspre-commit.git diff --colordocumentation.code in question: https://github.com/pre-commit/pre-commit/blob/master/pre_commit/commands/run.py#L227