diff options
author | Ralf Thielow <ralf.thielow@gmail.com> | 2013-01-10 18:45:59 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-10 11:45:02 -0800 |
commit | 51fb3a3dfa4ffeeb210fb0e7d6f631503a5a1dfb (patch) | |
tree | 17e4f55ceaa5af76c77f41f51cb46f801657fdff /builtin/commit.c | |
parent | 44fe83502edf5391bb3a5997cab01794b4568062 (diff) | |
download | git-51fb3a3dfa4ffeeb210fb0e7d6f631503a5a1dfb.tar.gz git-51fb3a3dfa4ffeeb210fb0e7d6f631503a5a1dfb.tar.xz |
commit: make default of "cleanup" option configurable
The default of the "cleanup" option in "git commit"
is not configurable. Users who don't want to use the
default have to pass this option on every commit since
there's no way to configure it. This commit introduces
a new config option "commit.cleanup" which can be used
to change the default of the "cleanup" option in
"git commit".
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index d6dd3df8b..7c2a3d48b 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -103,7 +103,7 @@ static enum { CLEANUP_NONE, CLEANUP_ALL } cleanup_mode; -static char *cleanup_arg; +static const char *cleanup_arg; static enum commit_whence whence; static int use_editor = 1, include_status = 1; @@ -1320,6 +1320,8 @@ static int git_commit_config(const char *k, const char *v, void *cb) include_status = git_config_bool(k, v); return 0; } + if (!strcmp(k, "commit.cleanup")) + return git_config_string(&cleanup_arg, k, v); status = git_gpg_config(k, v, NULL); if (status) |