X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-commit.c;h=69241f8ed6245b4f80f8758540bdd1aba926c4ce;hb=91fe7324c5a5a11a7fff4993ce5ded81b6e3ee08;hp=592b10396d1d6aa25d5d1c0aa27556c93c219877;hpb=a4c3616b19700cc60e06096f59c4aae0e6635cfe;p=git.git diff --git a/builtin-commit.c b/builtin-commit.c index 592b10396..69241f8ed 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -68,7 +68,7 @@ static enum { } cleanup_mode; static char *cleanup_arg; -static int use_editor = 1, initial_commit, in_merge; +static int use_editor = 1, initial_commit, in_merge, include_status = 1; static const char *only_include_assumed; static struct strbuf message; @@ -107,6 +107,7 @@ static struct option builtin_commit_options[] = { OPT_FILENAME('t', "template", &template_file, "use specified template file"), OPT_BOOLEAN('e', "edit", &edit_flag, "force edit of commit"), OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"), + OPT_BOOLEAN(0, "status", &include_status, "include status in commit message template"), /* end commit message options */ OPT_GROUP("Commit contents options"), @@ -590,7 +591,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, /* This checks if committer ident is explicitly given */ git_committer_info(0); - if (use_editor) { + if (use_editor && include_status) { char *author_ident; const char *committer_ident; @@ -1105,6 +1106,10 @@ static int git_commit_config(const char *k, const char *v, void *cb) if (!strcmp(k, "commit.template")) return git_config_pathname(&template_file, k, v); + if (!strcmp(k, "commit.status")) { + include_status = git_config_bool(k, v); + return 0; + } return git_status_config(k, v, s); } @@ -1250,7 +1255,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) "new_index file. Check that disk is not full or quota is\n" "not exceeded, and then \"git reset HEAD\" to recover."); - rerere(); + rerere(0); run_hook(get_index_file(), "post-commit", NULL); if (!quiet) print_summary(prefix, commit_sha1);