Skip to contentSkip to conversation

Teach merge.log to "git-merge" again

PATCH New Junio C Hamano 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Teach merge.log to "git-merge" again

The command forgot the configuration variable when rewritten in C.

---
 builtin-merge.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
builtin-merge.c +2 -0
index 821edcd..bc3f921 100644
@@ -519,8 +519,10 @@ int git_merge_config(const char *k, const char *v, void *cb)
 	else if (!strcmp(k, "pull.twohead"))
 		return git_config_string(&pull_twohead, k, v);
 	else if (!strcmp(k, "pull.octopus"))
 		return git_config_string(&pull_octopus, k, v);
+	else if (!strcmp(k, "merge.log") || !strcmp(k, "merge.summary"))
+		option_log = git_config_bool(k, v);
 	return git_diff_ui_config(k, v, cb);
 }
 
 static int read_tree_trivial(unsigned char *common, unsigned char *head,
#1 lore raw

PATCH 1/1 Add testcase for merge.log

Make sure that the merge.log boolean config setting is the same as --log and --no-log.

---

Quoted 1 line · Junio C Hamano

The command forgot the configuration variable when rewritten in C.

Thanks. Here is a testcase.

 t/t7600-merge.sh |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
t/t7600-merge.sh +11 -0
index dfddd86..a3c17a9 100755
@@ -456,6 +456,17 @@ test_expect_success 'merge log message' '
 	verify_diff msg.log msg.act "[OOPS] bad merge log message"
 '
 
+test_expect_success 'merge log message (from config)' '
+	git reset --hard c0 &&
+	git merge c2 &&
+	git show -s --pretty=format:%b HEAD >msg.act &&
+	verify_diff msg.nolog msg.act "[OOPS] bad merge log message" &&
+	git config merge.log true &&
+	git merge c3 &&
+	git show -s --pretty=format:%b HEAD >msg.act &&
+	verify_diff msg.log msg.act "[OOPS] bad merge log message"
+'
+
 test_debug 'gitk --all'
 
 test_done
Signature · 1 line
1.5.6.2.450.g8d367.dirty
#2 lore raw

Re: [PATCH] Add testcase for merge.log

Quoted 4 lines · Miklos Vajna
Quoted 1 line · Junio C Hamano

The command forgot the configuration variable when rewritten in C.

Thanks. Here is a testcase.

As far as I see this has been forgotten. Should I resend it on top of current mv/merge-in-c?

Thanks.