Re: [PATCH] Add .gitconfig variable commit.gpg-sign

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Add .gitconfig variable commit.gpg-sign

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:57

Joel Jacobson [off-list ref] writes:
Signed-off-by: Joel Jacobson <redacted>
---
 builtin/commit.c | 4 +++-
No docs?  No tests?

As to the design, any regular configuration variable settings must
be overridable from the command line for a single invocation. Please
design an escape hatch in, for somebody who has this configuration
variable set, but does not want to sign this commit he is about to
make.

Also do we generally use dash in the configuration variable names?
I thought the norm was section.CamelCase.
+       if (!strcmp(k, "commit.gpg-sign"))
+               return git_config_string(&sign_commit, k, v);
        if (!strcmp(k, "commit.cleanup"))
                return git_config_string(&cleanup_arg, k, v);

--
--to=gitster@pobox.com

Re: [PATCH] Add .gitconfig variable commit.gpg-sign

From: Joel Jacobson <hidden>
Date: 2016-06-15 22:56:58

On Tue, Apr 23, 2013 at 12:43 AM, Junio C Hamano [off-list ref] wrote:
No docs?  No tests?
Maybe simply adding this text to git-commit.txt,

The default can be changed by the 'commit.gpg-sign' configuration
variable (see linkgit:git-config[1]).

after,

-S[<keyid>]::
--gpg-sign[=<keyid>]::
GPG-sign commit.

would be sufficient?

Not sure what the proper way to test this,
could you please suggest any other unit test I could look at for inspiration?
As to the design, any regular configuration variable settings must
be overridable from the command line for a single invocation. Please
design an escape hatch in, for somebody who has this configuration
variable set, but does not want to sign this commit he is about to
make.
Something like --no-gpg-sign?
Also do we generally use dash in the configuration variable names?
I thought the norm was section.CamelCase.
Since the command line long option is "gpg-sign", I thought it was best
to use exactly the same term in the configuration variable name to
avoid confusion. Is there any problem with dashes in variable names?

Re: [PATCH] Add .gitconfig variable commit.gpg-sign

From: Michael J Gruber <hidden>
Date: 2016-06-15 22:56:58

Joel Jacobson venit, vidit, dixit 23.04.2013 02:00:
On Tue, Apr 23, 2013 at 12:43 AM, Junio C Hamano [off-list ref] wrote:
quoted
No docs?  No tests?
Maybe simply adding this text to git-commit.txt,

The default can be changed by the 'commit.gpg-sign' configuration
variable (see linkgit:git-config[1]).

after,

-S[<keyid>]::
--gpg-sign[=<keyid>]::
GPG-sign commit.

would be sufficient?

Not sure what the proper way to test this,
could you please suggest any other unit test I could look at for inspiration?
quoted
As to the design, any regular configuration variable settings must
be overridable from the command line for a single invocation. Please
design an escape hatch in, for somebody who has this configuration
variable set, but does not want to sign this commit he is about to
make.
Something like --no-gpg-sign?
quoted
Also do we generally use dash in the configuration variable names?
I thought the norm was section.CamelCase.
Since the command line long option is "gpg-sign", I thought it was best
to use exactly the same term in the configuration variable name to
avoid confusion. Is there any problem with dashes in variable names?
Not really a problem, but as Junio writes, we don't use dashes in the
config.

As for the command line override:

Don't we have "git -c commit.gpgsign=false" and such these days, so that
we don't have to inflate options any more?

Michael
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help