commit-tree: add and document --no-gpg-sign
authorJunio C Hamano <gitster@pobox.com>
Fri, 13 Dec 2013 23:40:35 +0000 (15:40 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Feb 2014 22:51:35 +0000 (14:51 -0800)
Document how to override commit.gpgsign configuration that is set to
true per "git commit" invocation (parse-options machinery lets us
say "--no-gpg-sign" to do so).

"git commit-tree" does not use parse-options, so manually add the
corresponding option for now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-commit-tree.txt
Documentation/git-commit.txt
builtin/commit-tree.c
index cafdc9642d312776b0122c4d010a9e9246bad8ff..a469eab06683dece65f447a6c2691c30fe54b214 100644 (file)
@@ -55,8 +55,13 @@ OPTIONS
        from the standard input.
 
 -S[<keyid>]::
+--gpg-sign[=<keyid>]::
        GPG-sign commit.
 
+--no-gpg-sign::
+       Countermand `commit.gpgsign` configuration variable that is
+       set to force each and every commit to be signed.
+
 
 Commit Information
 ------------------
index 1a7616c73a204f69bca98d0ff7f4cdfda20ba420..7c42e9cabcb250b93cd286e8efe23df90ea0f71c 100644 (file)
@@ -302,6 +302,10 @@ configuration variable documented in linkgit:git-config[1].
 --gpg-sign[=<keyid>]::
        GPG-sign commit.
 
+--no-gpg-sign::
+       Countermand `commit.gpgsign` configuration variable that is
+       set to force each and every commit to be signed.
+
 \--::
        Do not interpret any more arguments as options.
 
index 1646d5b25e4fe66cdb84a09aba87cb2f09f8c572..987a4c3d731d7cf01f61e4fddec208b4cb51a4af 100644 (file)
@@ -71,6 +71,11 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
                        continue;
                }
 
+               if (!strcmp(arg, "--no-gpg-sign")) {
+                       sign_commit = NULL;
+                       continue;
+               }
+
                if (!strcmp(arg, "-m")) {
                        if (argc <= ++i)
                                usage(commit_tree_usage);