-
Notifications
You must be signed in to change notification settings - Fork 391
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
Skip specified settings in .gitconfig #340
Conversation
Hi @Ryuta69, isn't this confusingly similar to the existing |
@dandavison I personally didn't find it similar, but should I change the name maybe....? |
skip-config
option to disable git-config value.skip-config
option to disable git-config value of only keys you specify (while --git-config disables whole settings.)).
@dandavison There is an another suggestion, how do you think below plans?
|
Hi @Ryuta69, thanks for working on this and thinking about it. I still need to think about it a bit more, but I do like your idea of changing |
@dandavison As I stated here #331 (comment), this one is not urgent for release in my opinion. I'm going to work for this, but there's no problem to release without this because the --pager is the first priotiry. |
Because it is more clear for users who often used this option. If this remains, they will be surprised at this option not working withuout errors.
skip-config
option to disable git-config value of only keys you specify (while --git-config disables whole settings.)).} | ||
|
||
if !self.ignored_keys.is_empty() { | ||
let key_name = &key.rsplit('.').collect::<Vec<&str>>()[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keys will be
- core.pager
- delta.line-numbers
- delta.features.line-numbers
I think users don't want to specify parent key, so I split key here.
@dandavison |
Thanks @Ryuta69, I'll review as soon as I can. Your other changes are all merged, right? So we could do a delta release now? |
@dandavison All other PRs are merged, so there are no problems for release. |
OK, all your changes are released in delta 0.4.4, thanks very much for all the work! |
@dandavison If this approach is preferrable, I'm going to start fix conflicts. |
Hi @ulwlu, I'm hesitant about this one. Here is what I'm asking myself:
But I don't have a clear sense here of what is best. |
@dandavison
The purpose of creating this PR was written in description (I am trying to achieve with less maintenance. Since there is no automatic negative boolean in clap). I'm going to close this, and will keep above plan in mind. |
Thanks @ulwlu, sounds like we agree. Let's keep thinking about the environment variable option. Above I suggested |
Could we have a 2nd config file, possibly using the same format as gitconfig, and overriding anything set there? |
@HaleTom can you expand on that -- what's an example of a problem that would be solved by having a second config file? |
@HaleTom I think I see what you're suggesting -- we could have a second config file containing an alternative config that we sometimes need to use as a variant, overriding values in the main config file. I think that we actually already have that: that is essentially what named custom "features" are. There are already precedence rules built into the features implementation, so they allow overriding in a predictable way. And we can define as many variant configs as we want as named features. The only question seems to be -- how do we select our features conveniently at the command line (which would also be a question for your suggestion of having a second config file, right?) I am thinking that we want this to be possible without having to pipe git into delta to apply a command-line arg, in which case an environment variable seems like the way forwards, since that will affect e.g. So as a third variant of the above environment variable ideas, I wonder whether we only need one new environment variable: |
Just giving that a very quick go I see that a bit of work might be required: the following would ideally have worked first time but did not: [delta]
line-numbers = true
features = no-line-numbers
[delta "no-line-numbers"]
line-numbers = false |
You got me, @dandavison . Cheers! |
@dandavison Hi shall I check that behaviour?
I actually found this bug when fixing git add pager, because some styles like hunk_header_style breaks pager while hunk_header_style in features won't break it. I totally forgot where it happens, but maybe can fix. |
@ulwlu , thanks! Yes, that would be great. I opened #446 for it. In addition to #307 I think that |
Okay! I'm gonna start working this in a few days because I need take a surgery today. |
Awesome, no hurry! I hope that goes smoothly and you're feeling good after. |
Fix #307.
Bool option couldn't be disabled by command.
There was three options to solve this,
--no-gitconfig
option to Vec, and it will ignore those specified keys. <- This one option can disable as much options as you want. Also, you can skip some non-bool config at same time. It will be useful.I'm still not sure if this way is the best, so I titled 'suggestion'.
I would like to hear any ideas.