-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add file based configuration. #121
Conversation
This adds [git-config](https://git-scm.com/docs/git-config) based configuration for gitsign values. Caveats: - GITSIGN_CREDENTIAL_CACHE intentionally not supported since this is likely changing soon. - We do not use subsections (i.e. we use gitsign.issuer instead of gitsign.oidc.issuer). This gives us some wiggle room to add host based config later on similar to https://git-scm.com/docs/gitcredentials Signed-off-by: Billy Lynch <[email protected]>
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.
cool
lgtm
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.
This looks great! One foot gun preventing suggestion.
out.Issuer = o.Value | ||
case "logPath": | ||
out.LogPath = o.Value | ||
} |
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.
I know git eats output but Is there a way you can warn about an unknown (or mistyped) value in the default case?
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.
There's a bit of a chicken and egg problem, since we use the config to set up some of the output writers (i.e. GITSIGN_LOG).
We could refactor just the tty input/output setup to capture this if we really wanted, but I'm also not too worried about it - this behavior is something that is present for most git configs (i.e. you can do git config --local gpg.foo bar
and it won't complain), and it seems to be manageable for most people. We still have -v
as a fall back to verify parsed values as a sanity check.
Summary
This adds git-config based configuration for gitsign values.
Caveats:
likely changing soon (see Easier credential caching #98)
This gives us some wiggle room to add host based config later on
similar to https://git-scm.com/docs/gitcredentials
Signed-off-by: Billy Lynch [email protected]
Fixes #99
Release Note
Documentation
Will update once new release is cut. This is a backwards compatible change.