Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-22 20:31:48 +0400
committerJunio C Hamano <gitster@pobox.com>2010-06-22 20:31:48 +0400
commit81b43b54b2b6cfe917820b26bf206254d8b6738e (patch)
tree4ecbf2b05ad5e27fed309025a28c91127c074a82 /builtin
parentabd3fd358b73c3a09eb0e70ebe91cd8807c9777d (diff)
parent643cb5f7c99e77a4a3e97213dd226a7dc2650c02 (diff)
Merge branch 'cc/maint-commit-reflog-msg' into maint
* cc/maint-commit-reflog-msg: commit: use value of GIT_REFLOG_ACTION env variable as reflog message
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 9d59af0344..80c621dc06 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1252,13 +1252,16 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
}
/* Determine parents */
+ reflog_msg = getenv("GIT_REFLOG_ACTION");
if (initial_commit) {
- reflog_msg = "commit (initial)";
+ if (!reflog_msg)
+ reflog_msg = "commit (initial)";
} else if (amend) {
struct commit_list *c;
struct commit *commit;
- reflog_msg = "commit (amend)";
+ if (!reflog_msg)
+ reflog_msg = "commit (amend)";
commit = lookup_commit(head_sha1);
if (!commit || parse_commit(commit))
die("could not parse HEAD commit");
@@ -1269,7 +1272,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
struct strbuf m = STRBUF_INIT;
FILE *fp;
- reflog_msg = "commit (merge)";
+ if (!reflog_msg)
+ reflog_msg = "commit (merge)";
pptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;
fp = fopen(git_path("MERGE_HEAD"), "r");
if (fp == NULL)
@@ -1292,7 +1296,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
if (allow_fast_forward)
parents = reduce_heads(parents);
} else {
- reflog_msg = "commit";
+ if (!reflog_msg)
+ reflog_msg = "commit";
pptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;
}