Robin Green <
gre...@gmail.com> writes:
> I have installed overcommit[1] as a pre-commit hook. It outputs ANSI
> escape sequences to set colors, and these are rendered as follows in
> the magit-process buffer:
>
> I am not sure who is at fault here. overcommit appears to be doing the
> right thing by testing whether its output is a tty, at least at a
> quick glance at its code. Maybe magit is telling git not to output
> colors, but still communicating with git using a pseudoterminal, so
> that git hook scripts believe they are running in a terminal?
Magit by default indeed uses tty when running Git (see
`magit-process-connection-type') but it does *not* tell Git to not color
the output explicitly (see `magit-git-global-arguments'), so Git must be
figuring it out itself.
We do have to use a tty because otherwise we cannot read the password
from the user. On Windows we have to hack around this, so to avoid
having to do that for other platforms, we will keep using a tty by
default.
You should probably ask for an `overcommit' option or setting which can
be used to tell it not to color the output.