@matheusbsbs / matheus-bagliano / commits / bd2549ca6b
Fork 0

t6200-fmt-merge-msg: Exercise '--log' to configure shortlog length

Add a test to exercise the '--log' command-line option of 'git fmt-merge-msg'. It controls the number of shortlog entries to display in merge commit messages. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Thanks-to: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramkumar Ramachandra committed Sep 8, 2010 at 23:29 UTC bd2549ca6b0b2d897e073bbaa34c1fee46acd8f0
1 file changed +43
t/t6200-fmt-merge-msg.sh
+43
@@ -177,6 +177,49 @@ test_expect_success 'merge.log=0 disables shortlog' '
177 test_cmp expected actual
178 '
179
180 +test_expect_success '--log=3 limits shortlog length' '
181 + cat >expected <<-EOF &&
182 + Merge branch ${apos}left${apos}
183 +
184 + * left: (5 commits)
185 + Left #5
186 + Left #4
187 + Left #3
188 + ...
189 + EOF
190 +
191 + git fmt-merge-msg --log=3 <.git/FETCH_HEAD >actual &&
192 + test_cmp expected actual
193 +'
194 +
195 +test_expect_success '--log=5 shows all 5 commits' '
196 + cat >expected <<-EOF &&
197 + Merge branch ${apos}left${apos}
198 +
199 + * left:
200 + Left #5
201 + Left #4
202 + Left #3
203 + Common #2
204 + Common #1
205 + EOF
206 +
207 + git fmt-merge-msg --log=5 <.git/FETCH_HEAD >actual &&
208 + test_cmp expected actual
209 +'
210 +
211 +test_expect_success '--no-log disables shortlog' '
212 + echo "Merge branch ${apos}left${apos}" >expected &&
213 + git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual &&
214 + test_cmp expected actual
215 +'
216 +
217 +test_expect_success '--log=0 disables shortlog' '
218 + echo "Merge branch ${apos}left${apos}" >expected &&
219 + git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual &&
220 + test_cmp expected actual
221 +'
222 +
223 test_expect_success 'fmt-merge-msg -m' '
224 echo "Sync with left" >expected &&
225 cat >expected.log <<-EOF &&