Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bat's gitllog language-colorization is slightly confused by git log --decorate=[short|full] output #1632

Open
hivehand opened this issue May 4, 2021 · 1 comment
Labels
bug Something isn't working syntax-highlighting upstream-error A bug in an upstream component

Comments

@hivehand
Copy link

hivehand commented May 4, 2021

Describe the bug you encountered:

If I pipe the output of git log through bat as follows, each commit line is properly colored:

git log | bat  

image

If, however, I tell git to decorate the log using the --decorate flag, any commit lines sporting a ref appear in plain white, with no coloring.

git log --decorate=short | bat

image

What did you expect to happen instead?

I expected the commit text, and the hash, to be colored as they are for ref-free commits; I would like for the "HEAD", "master", and origin refs to be colored as they are in regular git log output.

image

How did you install bat?

Via Homebrrew.

bat version and environment

Software version

bat 0.18.0

Operating system

Darwin 20.4.0

Command-line

bat --diagnostic

Environment variables

SHELL=/usr/local/bin/fish
PAGER=less
BAT_PAGER=<not set>
BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
XDG_CONFIG_HOME=<not set>
XDG_CACHE_HOME=<not set>
COLORTERM=truecolor
NO_COLOR=<not set>
MANPAGER=<not set>

Config file

--map-syntax "*.ino:C++"
--style plain
--theme "Coldark-Dark"

Compile time information

  • Profile: release
  • Target triple: x86_64-apple-darwin
  • Family: unix
  • OS: macos
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2,sse3,ssse3
  • Host: x86_64-apple-darwin

Less version

> less --version
less 487 (POSIX regular expressions)
Copyright (C) 1984-2016  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Homepage: http://www.greenwoodsoftware.com/less

P.S.

Incidentally, thanks! I absolutely love, and am grateful for, bat — both because it deals gracefully with nearly all of the situations I've thrown at it, and because its atomic-binary nature means I can easily copy it to systems I don't have root access to. Cheers!

@sharkdp
Copy link
Owner

sharkdp commented Jul 25, 2021

Thank you for reporting this and thank you for the feedback!

See this comment by @keith-hall for some progress on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working syntax-highlighting upstream-error A bug in an upstream component
Projects
None yet
Development

No branches or pull requests

3 participants