less itself isn't capable of doing syntax highlighting, according to this thread.
git diff nicely shows colored output in less, its default pager. When I redirect the output of
git diff into a file, no color escape sequences are visible.
git diff know where it's being sent, and formats the output accordingly? How would one do that?
I just noticed that git colors the
diff output (e.g.
git diff), however, it doesn't know how to syntax highlighting in general. e.g.
git show 415fec6:log.tex
doesn't enable any TeX-like syntax.
git sources, I found the following hints
I was previously referring to syntax highlighting, but that was not correct. What I mean is output coloring, see e.g.