Skip to content

Commit 9830a9c

Browse files
committed
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 <[email protected]>
1 parent 418a143 commit 9830a9c

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

builtin/fmt-merge-msg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ static void credit_people(struct strbuf *out,
243243
const char *me;
244244

245245
if (kind == 'a') {
246-
label = "\nBy ";
246+
label = "\n# By ";
247247
me = git_author_info(IDENT_NO_DATE);
248248
} else {
249-
label = "\nvia ";
249+
label = "\n# Via ";
250250
me = git_committer_info(IDENT_NO_DATE);
251251
}
252252

t/t6200-fmt-merge-msg.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ test_expect_success '[merge] summary/log configuration' '
102102
cat >expected <<-EOF &&
103103
Merge branch ${apos}left${apos}
104104
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
107107
* left:
108108
Left #5
109109
Left #4
@@ -149,8 +149,8 @@ test_expect_success 'merge.log=3 limits shortlog length' '
149149
cat >expected <<-EOF &&
150150
Merge branch ${apos}left${apos}
151151
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
154154
* left: (5 commits)
155155
Left #5
156156
Left #4
@@ -166,8 +166,8 @@ test_expect_success 'merge.log=5 shows all 5 commits' '
166166
cat >expected <<-EOF &&
167167
Merge branch ${apos}left${apos}
168168
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
171171
* left:
172172
Left #5
173173
Left #4
@@ -190,8 +190,8 @@ test_expect_success '--log=3 limits shortlog length' '
190190
cat >expected <<-EOF &&
191191
Merge branch ${apos}left${apos}
192192
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
195195
* left: (5 commits)
196196
Left #5
197197
Left #4
@@ -207,8 +207,8 @@ test_expect_success '--log=5 shows all 5 commits' '
207207
cat >expected <<-EOF &&
208208
Merge branch ${apos}left${apos}
209209
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
212212
* left:
213213
Left #5
214214
Left #4
@@ -238,8 +238,8 @@ test_expect_success 'fmt-merge-msg -m' '
238238
cat >expected.log <<-EOF &&
239239
Sync with left
240240
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
243243
* ${apos}left${apos} of $(pwd):
244244
Left #5
245245
Left #4
@@ -271,8 +271,8 @@ test_expect_success 'setup: expected shortlog for two branches' '
271271
cat >expected <<-EOF
272272
Merge branches ${apos}left${apos} and ${apos}right${apos}
273273
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
276276
* left:
277277
Left #5
278278
Left #4
@@ -396,8 +396,8 @@ test_expect_success 'merge-msg two tags' '
396396
Common #2
397397
Common #1
398398
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
401401
* tag ${apos}tag-l5${apos}:
402402
Left #5
403403
Left #4
@@ -426,8 +426,8 @@ test_expect_success 'merge-msg tag and branch' '
426426
Common #2
427427
Common #1
428428
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
431431
* left:
432432
Left #5
433433
Left #4

0 commit comments

Comments
 (0)