bigH / git-fuzzy

interactive `git` with the help of `fzf`
MIT License
2.3k stars 42 forks source link

Highlight git logs like in the preview #40

Closed Morikko closed 2 years ago

Morikko commented 2 years ago

For the command git fuzzy log, the preview shows the commit history with colors.

2021-07-23_18-01 git log highlight

When I do git fuzzy log, the lines are all white. If I run git log --pretty=oneline --abbrev-commit directly in my terminal, then I have colors.

How is it possible to keep the colors or to set up them ?

bigH commented 2 years ago

I suspect it may be that git log is noticing that it's being used in a pipe and turns off colors:

export GF_LOG_MENU_PARAMS='--pretty=oneline'

If that doesn't work, I can't explain why you're not getting colors. The git wrapper used internally sets -c color.ui=always.

(same answer as #38 though these may not have the same root cause)

Morikko commented 2 years ago

Using export GF_LOG_MENU_PARAMS='--color=always --abbrev-commit --oneline' resolves it for me. The --color=always part.

I got inspired by this: https://unix.stackexchange.com/a/372000/252146

The doc for git log is the same as regarding the parameter color. I have no idea of what color.ui means.