145
146
test_expect_success 'left alignment formatting' '
147
git log --pretty="tformat:%<(40)%s" >actual &&
148
- qz_to_tab_space <<EOF >expected &&
149
-message two Z
150
-message one Z
151
-add bar Z
152
-$(commit_msg) Z
153
-EOF
148
+ qz_to_tab_space <<-EOF >expected &&
149
+ message two Z
150
+ message one Z
151
+ add bar Z
152
+ $(commit_msg) Z
153
+ EOF
154
test_cmp expected actual
155
'
156
157
test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '
158
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(40)%s" >actual &&
159
- qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
160
-message two Z
161
-message one Z
162
-add bar Z
163
-$(commit_msg) Z
164
-EOF
159
+ qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
160
+ message two Z
161
+ message one Z
162
+ add bar Z
163
+ $(commit_msg) Z
164
+ EOF
165
test_cmp expected actual
166
'
167
168
test_expect_success 'left alignment formatting at the nth column' '
169
git log --pretty="tformat:%h %<|(40)%s" >actual &&
170
- qz_to_tab_space <<EOF >expected &&
171
-$head1 message two Z
172
-$head2 message one Z
173
-$head3 add bar Z
174
-$head4 $(commit_msg) Z
175
-EOF
170
+ qz_to_tab_space <<-EOF >expected &&
171
+ $head1 message two Z
172
+ $head2 message one Z
173
+ $head3 add bar Z
174
+ $head4 $(commit_msg) Z
175
+ EOF
176
test_cmp expected actual
177
'
178
179
test_expect_success 'left alignment formatting at the nth column' '
180
COLUMNS=50 git log --pretty="tformat:%h %<|(-10)%s" >actual &&
181
- qz_to_tab_space <<EOF >expected &&
182
-$head1 message two Z
183
-$head2 message one Z
184
-$head3 add bar Z
185
-$head4 $(commit_msg) Z
186
-EOF
181
+ qz_to_tab_space <<-EOF >expected &&
182
+ $head1 message two Z
183
+ $head2 message one Z
184
+ $head3 add bar Z
185
+ $head4 $(commit_msg) Z
186
+ EOF
187
test_cmp expected actual
188
'
189
190
test_expect_success 'left alignment formatting at the nth column. i18n.logOutputEncoding' '
191
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %<|(40)%s" >actual &&
192
- qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
193
-$head1 message two Z
194
-$head2 message one Z
195
-$head3 add bar Z
196
-$head4 $(commit_msg) Z
197
-EOF
192
+ qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
193
+ $head1 message two Z
194
+ $head2 message one Z
195
+ $head3 add bar Z
196
+ $head4 $(commit_msg) Z
197
+ EOF
198
test_cmp expected actual
199
'
200
201
test_expect_success 'left alignment formatting with no padding' '
202
git log --pretty="tformat:%<(1)%s" >actual &&
203
- cat <<EOF >expected &&
204
-message two
205
-message one
206
-add bar
207
-$(commit_msg)
208
-EOF
203
+ cat <<-EOF >expected &&
204
+ message two
205
+ message one
206
+ add bar
207
+ $(commit_msg)
208
+ EOF
209
test_cmp expected actual
210
'
211
212
test_expect_success 'left alignment formatting with no padding. i18n.logOutputEncoding' '
213
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(1)%s" >actual &&
214
- cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
215
-message two
216
-message one
217
-add bar
218
-$(commit_msg)
219
-EOF
214
+ cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
215
+ message two
216
+ message one
217
+ add bar
218
+ $(commit_msg)
219
+ EOF
220
test_cmp expected actual
221
'
222
223
test_expect_success 'left alignment formatting with trunc' '
224
git log --pretty="tformat:%<(10,trunc)%s" >actual &&
225
- qz_to_tab_space <<EOF >expected &&
226
-message ..
227
-message ..
228
-add bar Z
229
-initial...
230
-EOF
225
+ qz_to_tab_space <<-\EOF >expected &&
226
+ message ..
227
+ message ..
228
+ add bar Z
229
+ initial...
230
+ EOF
231
test_cmp expected actual
232
'
233
234
test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncoding' '
235
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s" >actual &&
236
- qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
237
-message ..
238
-message ..
239
-add bar Z
240
-initial...
241
-EOF
236
+ qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected &&
237
+ message ..
238
+ message ..
239
+ add bar Z
240
+ initial...
241
+ EOF
242
test_cmp expected actual
243
'
244
245
test_expect_success 'left alignment formatting with ltrunc' '
246
git log --pretty="tformat:%<(10,ltrunc)%s" >actual &&
247
- qz_to_tab_space <<EOF >expected &&
248
-..sage two
249
-..sage one
250
-add bar Z
251
-..${sample_utf8_part}lich
252
-EOF
247
+ qz_to_tab_space <<-EOF >expected &&
248
+ ..sage two
249
+ ..sage one
250
+ add bar Z
251
+ ..${sample_utf8_part}lich
252
+ EOF
253
test_cmp expected actual
254
'
255
256
test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncoding' '
257
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,ltrunc)%s" >actual &&
258
- qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
259
-..sage two
260
-..sage one
261
-add bar Z
262
-..${sample_utf8_part}lich
263
-EOF
258
+ qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
259
+ ..sage two
260
+ ..sage one
261
+ add bar Z
262
+ ..${sample_utf8_part}lich
263
+ EOF
264
test_cmp expected actual
265
'
266
267
test_expect_success 'left alignment formatting with mtrunc' '
268
git log --pretty="tformat:%<(10,mtrunc)%s" >actual &&
269
- qz_to_tab_space <<EOF >expected &&
270
-mess.. two
271
-mess.. one
272
-add bar Z
273
-init..lich
274
-EOF
269
+ qz_to_tab_space <<-\EOF >expected &&
270
+ mess.. two
271
+ mess.. one
272
+ add bar Z
273
+ init..lich
274
+ EOF
275
test_cmp expected actual
276
'
277
278
test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncoding' '
279
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,mtrunc)%s" >actual &&
280
- qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
281
-mess.. two
282
-mess.. one
283
-add bar Z
284
-init..lich
285
-EOF
280
+ qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected &&
281
+ mess.. two
282
+ mess.. one
283
+ add bar Z
284
+ init..lich
285
+ EOF
286
test_cmp expected actual
287
'
288
289
test_expect_success 'right alignment formatting' '
290
git log --pretty="tformat:%>(40)%s" >actual &&
291
- qz_to_tab_space <<EOF >expected &&
292
-Z message two
293
-Z message one
294
-Z add bar
295
-Z $(commit_msg)
296
-EOF
291
+ qz_to_tab_space <<-EOF >expected &&
292
+ Z message two
293
+ Z message one
294
+ Z add bar
295
+ Z $(commit_msg)
296
+ EOF
297
test_cmp expected actual
298
'
299
300
test_expect_success 'right alignment formatting. i18n.logOutputEncoding' '
301
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(40)%s" >actual &&
302
- qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
303
-Z message two
304
-Z message one
305
-Z add bar
306
-Z $(commit_msg)
307
-EOF
302
+ qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
303
+ Z message two
304
+ Z message one
305
+ Z add bar
306
+ Z $(commit_msg)
307
+ EOF
308
test_cmp expected actual
309
'
310
311
test_expect_success 'right alignment formatting at the nth column' '
312
git log --pretty="tformat:%h %>|(40)%s" >actual &&
313
- qz_to_tab_space <<EOF >expected &&
314
-$head1 message two
315
-$head2 message one
316
-$head3 add bar
317
-$head4 $(commit_msg)
318
-EOF
313
+ qz_to_tab_space <<-EOF >expected &&
314
+ $head1 message two
315
+ $head2 message one
316
+ $head3 add bar
317
+ $head4 $(commit_msg)
318
+ EOF
319
test_cmp expected actual
320
'
321
322
test_expect_success 'right alignment formatting at the nth column' '
323
COLUMNS=50 git log --pretty="tformat:%h %>|(-10)%s" >actual &&
324
- qz_to_tab_space <<EOF >expected &&
325
-$head1 message two
326
-$head2 message one
327
-$head3 add bar
328
-$head4 $(commit_msg)
329
-EOF
324
+ qz_to_tab_space <<-EOF >expected &&
325
+ $head1 message two
326
+ $head2 message one
327
+ $head3 add bar
328
+ $head4 $(commit_msg)
329
+ EOF
330
test_cmp expected actual
331
'
332
333
test_expect_success 'right alignment formatting at the nth column. i18n.logOutputEncoding' '
334
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %>|(40)%s" >actual &&
335
- qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
336
-$head1 message two
337
-$head2 message one
338
-$head3 add bar
339
-$head4 $(commit_msg)
340
-EOF
335
+ qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
336
+ $head1 message two
337
+ $head2 message one
338
+ $head3 add bar
339
+ $head4 $(commit_msg)
340
+ EOF
341
test_cmp expected actual
342
'
343
345
# as in previous test.
346
test_expect_success 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '
347
git -c i18n.logOutputEncoding=$test_encoding log --graph --pretty="tformat:%h %>|(40)%s" >actual &&
348
- iconv -f utf-8 -t $test_encoding >expected <<EOF&&
349
-* $head1 message two
350
-* $head2 message one
351
-* $head3 add bar
352
-* $head4 $(commit_msg)
353
-EOF
348
+ iconv -f utf-8 -t $test_encoding >expected <<-EOF &&
349
+ * $head1 message two
350
+ * $head2 message one
351
+ * $head3 add bar
352
+ * $head4 $(commit_msg)
353
+ EOF
354
test_cmp expected actual
355
'
356
357
test_expect_success 'right alignment formatting with no padding' '
358
git log --pretty="tformat:%>(1)%s" >actual &&
359
- cat <<EOF >expected &&
360
-message two
361
-message one
362
-add bar
363
-$(commit_msg)
364
-EOF
359
+ cat <<-EOF >expected &&
360
+ message two
361
+ message one
362
+ add bar
363
+ $(commit_msg)
364
+ EOF
365
test_cmp expected actual
366
'
367
368
test_expect_success 'right alignment formatting with no padding and with --graph' '
369
git log --graph --pretty="tformat:%>(1)%s" >actual &&
370
- cat <<EOF >expected &&
371
-* message two
372
-* message one
373
-* add bar
374
-* $(commit_msg)
375
-EOF
370
+ cat <<-EOF >expected &&
371
+ * message two
372
+ * message one
373
+ * add bar
374
+ * $(commit_msg)
375
+ EOF
376
test_cmp expected actual
377
'
378
379
test_expect_success 'right alignment formatting with no padding. i18n.logOutputEncoding' '
380
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(1)%s" >actual &&
381
- cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
382
-message two
383
-message one
384
-add bar
385
-$(commit_msg)
386
-EOF
381
+ cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
382
+ message two
383
+ message one
384
+ add bar
385
+ $(commit_msg)
386
+ EOF
387
test_cmp expected actual
388
'
389
390
test_expect_success 'center alignment formatting' '
391
git log --pretty="tformat:%><(40)%s" >actual &&
392
- qz_to_tab_space <<EOF >expected &&
393
-Z message two Z
394
-Z message one Z
395
-Z add bar Z
396
-Z $(commit_msg) Z
397
-EOF
392
+ qz_to_tab_space <<-EOF >expected &&
393
+ Z message two Z
394
+ Z message one Z
395
+ Z add bar Z
396
+ Z $(commit_msg) Z
397
+ EOF
398
test_cmp expected actual
399
'
400
401
test_expect_success 'center alignment formatting. i18n.logOutputEncoding' '
402
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(40)%s" >actual &&
403
- qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
404
-Z message two Z
405
-Z message one Z
406
-Z add bar Z
407
-Z $(commit_msg) Z
408
-EOF
403
+ qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
404
+ Z message two Z
405
+ Z message one Z
406
+ Z add bar Z
407
+ Z $(commit_msg) Z
408
+ EOF
409
test_cmp expected actual
410
'
411
test_expect_success 'center alignment formatting at the nth column' '
412
git log --pretty="tformat:%h %><|(40)%s" >actual &&
413
- qz_to_tab_space <<EOF >expected &&
414
-$head1 message two Z
415
-$head2 message one Z
416
-$head3 add bar Z
417
-$head4 $(commit_msg) Z
418
-EOF
413
+ qz_to_tab_space <<-EOF >expected &&
414
+ $head1 message two Z
415
+ $head2 message one Z
416
+ $head3 add bar Z
417
+ $head4 $(commit_msg) Z
418
+ EOF
419
test_cmp expected actual
420
'
421
422
test_expect_success 'center alignment formatting at the nth column' '
423
COLUMNS=70 git log --pretty="tformat:%h %><|(-30)%s" >actual &&
424
- qz_to_tab_space <<EOF >expected &&
425
-$head1 message two Z
426
-$head2 message one Z
427
-$head3 add bar Z
428
-$head4 $(commit_msg) Z
429
-EOF
424
+ qz_to_tab_space <<-EOF >expected &&
425
+ $head1 message two Z
426
+ $head2 message one Z
427
+ $head3 add bar Z
428
+ $head4 $(commit_msg) Z
429
+ EOF
430
test_cmp expected actual
431
'
432
433
test_expect_success 'center alignment formatting at the nth column. i18n.logOutputEncoding' '
434
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %><|(40)%s" >actual &&
435
- qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
436
-$head1 message two Z
437
-$head2 message one Z
438
-$head3 add bar Z
439
-$head4 $(commit_msg) Z
440
-EOF
435
+ qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
436
+ $head1 message two Z
437
+ $head2 message one Z
438
+ $head3 add bar Z
439
+ $head4 $(commit_msg) Z
440
+ EOF
441
test_cmp expected actual
442
'
443
444
test_expect_success 'center alignment formatting with no padding' '
445
git log --pretty="tformat:%><(1)%s" >actual &&
446
- cat <<EOF >expected &&
447
-message two
448
-message one
449
-add bar
450
-$(commit_msg)
451
-EOF
446
+ cat <<-EOF >expected &&
447
+ message two
448
+ message one
449
+ add bar
450
+ $(commit_msg)
451
+ EOF
452
test_cmp expected actual
453
'
454
457
old_head1=$(git rev-parse --verify HEAD~0)
458
test_expect_success 'center alignment formatting with no padding. i18n.logOutputEncoding' '
459
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(1)%s" >actual &&
460
- cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
461
-message two
462
-message one
463
-add bar
464
-$(commit_msg)
465
-EOF
460
+ cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
461
+ message two
462
+ message one
463
+ add bar
464
+ $(commit_msg)
465
+ EOF
466
test_cmp expected actual
467
'
468
469
test_expect_success 'left/right alignment formatting with stealing' '
470
git commit --amend -m short --author "long long long <long@me.com>" &&
471
git log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
472
- cat <<EOF >expected &&
473
-short long long long
474
-message .. A U Thor
475
-add bar A U Thor
476
-initial... A U Thor
477
-EOF
472
+ cat <<-\EOF >expected &&
473
+ short long long long
474
+ message .. A U Thor
475
+ add bar A U Thor
476
+ initial... A U Thor
477
+ EOF
478
test_cmp expected actual
479
'
480
test_expect_success 'left/right alignment formatting with stealing. i18n.logOutputEncoding' '
481
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
482
- cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
483
-short long long long
484
-message .. A U Thor
485
-add bar A U Thor
486
-initial... A U Thor
487
-EOF
482
+ cat <<-\EOF | iconv -f utf-8 -t $test_encoding >expected &&
483
+ short long long long
484
+ message .. A U Thor
485
+ add bar A U Thor
486
+ initial... A U Thor
487
+ EOF
488
test_cmp expected actual
489
'
490
515
git tag -d tag1 &&
516
git commit --amend -m shorter &&
517
git log --no-walk --tags --pretty="%H %d" --decorate=full >actual &&
518
- cat <<EOF >expected &&
519
-$head1 (tag: refs/tags/tag2)
520
-$head2 (tag: refs/tags/message-one)
521
-$old_head1 (tag: refs/tags/message-two)
522
-EOF
518
+ cat <<-EOF >expected &&
519
+ $head1 (tag: refs/tags/tag2)
520
+ $head2 (tag: refs/tags/message-one)
521
+ $old_head1 (tag: refs/tags/message-two)
522
+ EOF
523
sort actual >actual1 &&
524
test_cmp expected actual1
525
'
526
527
test_expect_success 'clean log decoration' '
528
git log --no-walk --tags --pretty="%H %D" --decorate=full >actual &&
529
- cat >expected <<EOF &&
530
-$head1 tag: refs/tags/tag2
531
-$head2 tag: refs/tags/message-one
532
-$old_head1 tag: refs/tags/message-two
533
-EOF
529
+ cat >expected <<-EOF &&
530
+ $head1 tag: refs/tags/tag2
531
+ $head2 tag: refs/tags/message-one
532
+ $old_head1 tag: refs/tags/message-two
533
+ EOF
534
sort actual >actual1 &&
535
test_cmp expected actual1
536
'