One of my colleagues recently noticed a discrepancy between the normal git log
command, and and the following alias:
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
After a bit of poking, we found out that it may be related to the cygwin bash.
Here are our findings:
git log --graph
all commits visible
git log --oneline
some commits missing... okay! let's prepare an error report by redirecting the output to a text file:
git log --oneline > test.txt
Alas, all commits are visible in test.txt
?!?
Let's investigate further by taking apart the alias. Removing color codes:
git log --graph --pretty=format:'%h - %d %s (%cr) <%an>'
some commits missing. So it must be one of the variables...
[... some frobnications later ...]
git log --graph --pretty=format:'%h - %d %s (%cr)'
all commits visible
git log --graph --pretty=format:'%h - %d %s <%an>'
all commits visible
It seems to break after certain combinations of variables. In this case (%cr) <%an>
I also tried the same repository on linux and on there, it works as expected (i.e. all commits are shown in the log).
We would like to know why this is happening.
Try these to get closer to the cause:
$PAGER
and see how that affects the bug.$PAGER
is less
, save the log from inside less
(S), and/or -R to turn on /off processing of ANSI escapes, if you have color on.$LC_ALL
, $LANG
etc. try LANG=C git log
etc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With