From d95bfb12b87a0be9666f806683e198df9738d0e7 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Tue, 5 Nov 2013 00:14:41 +0100 Subject: commit-tree: add the commit.gpgsign option to sign all commits If you want to GPG sign all your commits, you have to add the -S option all the time. The commit.gpgsign config option allows to sign all commits automatically. Signed-off-by: Nicolas Vigier Signed-off-by: Junio C Hamano --- builtin/commit-tree.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'builtin/commit-tree.c') diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c index f641ff2a89..1646d5b25e 100644 --- a/builtin/commit-tree.c +++ b/builtin/commit-tree.c @@ -12,6 +12,8 @@ static const char commit_tree_usage[] = "git commit-tree [(-p )...] [-S[]] [-m ] [-F ] object.sha1; @@ -31,6 +33,10 @@ static int commit_tree_config(const char *var, const char *value, void *cb) int status = git_gpg_config(var, value, NULL); if (status) return status; + if (!strcmp(var, "commit.gpgsign")) { + sign_commit = git_config_bool(var, value) ? "" : NULL; + return 0; + } return git_default_config(var, value, cb); } @@ -41,7 +47,6 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix) unsigned char tree_sha1[20]; unsigned char commit_sha1[20]; struct strbuf buffer = STRBUF_INIT; - const char *sign_commit = NULL; git_config(commit_tree_config, NULL); -- cgit v1.2.1