fmt-merge-msg: make attribution into comment lines

The submaintainer credit is not something you can compute purely by looking at the history and its shape, especially in the presense of fast-forward merges, and this observation makes the information on the "via" line unreliable. Let's leave the final determination of credits up to whoever is making the merge and show them as comments. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jun 6, 2012 at 14:24 UTC 9830a9ca50ae269aa8858df596e32506c97cdd26
2 files changed +20 -20
builtin/fmt-merge-msg.c
+2 -2
@@ -243,10 +243,10 @@ static void credit_people(struct strbuf *out,
243 const char *me;
244
245 if (kind == 'a') {
246 - label = "\nBy ";
246 + label = "\n# By ";
247 me = git_author_info(IDENT_NO_DATE);
248 } else {
249 - label = "\nvia ";
249 + label = "\n# Via ";
250 me = git_committer_info(IDENT_NO_DATE);
251 }
252
t/t6200-fmt-merge-msg.sh
+18 -18
@@ -102,8 +102,8 @@ test_expect_success '[merge] summary/log configuration' '
102 cat >expected <<-EOF &&
103 Merge branch ${apos}left${apos}
104
105 - By Another Author (3) and A U Thor (2)
106 - via Another Committer
105 + # By Another Author (3) and A U Thor (2)
106 + # Via Another Committer
107 * left:
108 Left #5
109 Left #4
@@ -149,8 +149,8 @@ test_expect_success 'merge.log=3 limits shortlog length' '
149 cat >expected <<-EOF &&
150 Merge branch ${apos}left${apos}
151
152 - By Another Author (3) and A U Thor (2)
153 - via Another Committer
152 + # By Another Author (3) and A U Thor (2)
153 + # Via Another Committer
154 * left: (5 commits)
155 Left #5
156 Left #4
@@ -166,8 +166,8 @@ test_expect_success 'merge.log=5 shows all 5 commits' '
166 cat >expected <<-EOF &&
167 Merge branch ${apos}left${apos}
168
169 - By Another Author (3) and A U Thor (2)
170 - via Another Committer
169 + # By Another Author (3) and A U Thor (2)
170 + # Via Another Committer
171 * left:
172 Left #5
173 Left #4
@@ -190,8 +190,8 @@ test_expect_success '--log=3 limits shortlog length' '
190 cat >expected <<-EOF &&
191 Merge branch ${apos}left${apos}
192
193 - By Another Author (3) and A U Thor (2)
194 - via Another Committer
193 + # By Another Author (3) and A U Thor (2)
194 + # Via Another Committer
195 * left: (5 commits)
196 Left #5
197 Left #4
@@ -207,8 +207,8 @@ test_expect_success '--log=5 shows all 5 commits' '
207 cat >expected <<-EOF &&
208 Merge branch ${apos}left${apos}
209
210 - By Another Author (3) and A U Thor (2)
211 - via Another Committer
210 + # By Another Author (3) and A U Thor (2)
211 + # Via Another Committer
212 * left:
213 Left #5
214 Left #4
@@ -238,8 +238,8 @@ test_expect_success 'fmt-merge-msg -m' '
238 cat >expected.log <<-EOF &&
239 Sync with left
240
241 - By Another Author (3) and A U Thor (2)
242 - via Another Committer
241 + # By Another Author (3) and A U Thor (2)
242 + # Via Another Committer
243 * ${apos}left${apos} of $(pwd):
244 Left #5
245 Left #4
@@ -271,8 +271,8 @@ test_expect_success 'setup: expected shortlog for two branches' '
271 cat >expected <<-EOF
272 Merge branches ${apos}left${apos} and ${apos}right${apos}
273
274 - By Another Author (3) and A U Thor (2)
275 - via Another Committer
274 + # By Another Author (3) and A U Thor (2)
275 + # Via Another Committer
276 * left:
277 Left #5
278 Left #4
@@ -396,8 +396,8 @@ test_expect_success 'merge-msg two tags' '
396 Common #2
397 Common #1
398
399 - By Another Author (3) and A U Thor (2)
400 - via Another Committer
399 + # By Another Author (3) and A U Thor (2)
400 + # Via Another Committer
401 * tag ${apos}tag-l5${apos}:
402 Left #5
403 Left #4
@@ -426,8 +426,8 @@ test_expect_success 'merge-msg tag and branch' '
426 Common #2
427 Common #1
428
429 - By Another Author (3) and A U Thor (2)
430 - via Another Committer
429 + # By Another Author (3) and A U Thor (2)
430 + # Via Another Committer
431 * left:
432 Left #5
433 Left #4