I've installed Git for Windows and am generally pleased with the feature set in the Bash shell it provides. I'm having trouble with an alias that works fine everywhere else I've tried it.
The alias:
alias gl='git log --graph --format='\''%Cred%h%Creset %s %C(yellow)%an | %C(cyan)%ad%Creset %C(green bold)%d%Creset'\''' | less
In Cygwin, the MacOS bash terminal, and of course in a Linux shell, the alias produces nice results.
In GFW's Bash shell, the output is pretty mangled:
If I run the command directly, without an alias, it works correctly. So I know it's not that GFW's Bash shell doesn't know how to parse the command as I've written it.
My question: How do I get this alias to work correctly under Git For Windows?
I'm open to using an alternative to an alias. If a linux function or a true Git alias will work better I'm comfortable with those alternatives. It would be nice to figure out why this is happening, though.
UPDATE/DISCOVERY The problem doesn't appear to be with interpreting the alias at all. The output displays correctly if I remove the pipe to 'less'. So it looks like the 'less' command as implemented in the Git Bash Shell interprets the escape sequences differently (literally, I'd guess) than other implementations. As a result, no amount of wrapping the call in functions or such will address the core issue.