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

Feature request: support configuration via environment variable or config file #41

Closed
grossjohann opened this issue Dec 11, 2019 · 8 comments

Comments

@grossjohann
Copy link

I think it would be convenient if the --colors parameter wasn't the only way to customize the colors. Maybe if --colors is not provided, look in an environment variable? I guess using a config file is over-engineered.

For the time being, a short wrapper shell script will do the trick, of course.

@mookid
Copy link
Owner

mookid commented May 23, 2020

I think that the program is not complex enough to enough to justify a config file for now.

@mookid mookid closed this as completed May 23, 2020
@waldyrious
Copy link
Contributor

@mookid please reconsider. I've been following the development of a similar tool, and since they introduced git-config-based customization, the tool has been much more convenient to use and to tweak.

For reference, here's the invocation I currently have to use to tweak diffr's colors to match my preference (basically, mimicking diff-highlight):

diffr --colors refine-removed:foreground:black:nobold --colors refine-added:foreground:black:nobold

Having those settings in gitconfig, like this:

[core]
    pager = diffr | less -R

[interactive]
    diffFilter = diffr

[diffr "colors"]
    refine-removed = foreground:black:nobold 
    refine-added   = foreground:black:nobold

...would be much more manageable :)

@mookid
Copy link
Owner

mookid commented Jul 13, 2020

Hi @waldyrious, reopening. I won't say that this is high in my priority list, but could land sometime. The .gitconfig is indeed a nice place where to put the config if that's possible (even if I a not thrilled about being git specific).

@mookid mookid reopened this Jul 13, 2020
@grossjohann
Copy link
Author

@waldyrious I wonder what you think about the compromise to put the long command line into the git config?

[interactive]
diffFilter = diffr --colors refine-removed:foreground:black:nobold --colors refine-added:foreground:black:nobold

@waldyrious
Copy link
Contributor

It is, as you say, a workaround. It works, of course, but I'd like to be able to tweak the configuration more easily than editing a long string with a custom grammar. Using separate configuration entries makes the configuration easier to write, and easier to read. Also, it could reuse the same formatting specifications that git already uses, so that would be one less DSL to learn.

@xeruf
Copy link

xeruf commented Jan 19, 2021

@waldyrious I wonder what you think about the compromise to put the long command line into the git config?

[interactive]
diffFilter = diffr --colors refine-removed:foreground:black:nobold --colors refine-added:foreground:black:nobold

@grossjohann if you also want to use it in core.pager then you'd have to duplicate it or use an external script :/

@mookid mookid closed this as completed Dec 30, 2022
@waldyrious
Copy link
Contributor

@mookid I see you closed this issue as "completed". Did you mean to close it as "not planned"? Or did I miss something?

@mookid
Copy link
Owner

mookid commented Dec 30, 2022

yes, that's correct. I have no time to implement that, and nobody suggested code to do it either; as cleaning up the backlog, I closed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants