154
154
test_cmp expected actual
155
155
'
156
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
165
+ test_cmp expected actual
166
+ '
167
+
157
168
test_expect_success ' left alignment formatting at the nth column' '
158
169
git log --pretty="tformat:%h %<|(40)%s" >actual &&
159
170
qz_to_tab_space <<EOF >expected &&
165
176
test_cmp expected actual
166
177
'
167
178
179
+ test_expect_success ' left alignment formatting at the nth column. i18n.logOutputEncoding' '
180
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %<|(40)%s" >actual &&
181
+ qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >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
+
168
190
test_expect_success ' left alignment formatting with no padding' '
169
191
git log --pretty="tformat:%<(1)%s" >actual &&
170
192
cat <<EOF >expected &&
176
198
test_cmp expected actual
177
199
'
178
200
201
+ test_expect_success ' left alignment formatting with no padding. i18n.logOutputEncoding' '
202
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(1)%s" >actual &&
203
+ cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
204
+ message two
205
+ message one
206
+ add bar
207
+ $(commit_msg)
208
+ EOF
209
+ test_cmp expected actual
210
+ '
211
+
179
212
test_expect_success ' left alignment formatting with trunc' '
180
213
git log --pretty="tformat:%<(10,trunc)%s" >actual &&
181
214
qz_to_tab_space <<EOF >expected &&
187
220
test_cmp expected actual
188
221
'
189
222
223
+ test_expect_failure ' left alignment formatting with trunc. i18n.logOutputEncoding' '
224
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s" >actual &&
225
+ qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
226
+ message ..
227
+ message ..
228
+ add bar Z
229
+ initial...
230
+ EOF
231
+ test_cmp expected actual
232
+ '
233
+
190
234
test_expect_success ' left alignment formatting with ltrunc' '
191
235
git log --pretty="tformat:%<(10,ltrunc)%s" >actual &&
192
236
qz_to_tab_space <<EOF >expected &&
198
242
test_cmp expected actual
199
243
'
200
244
245
+ test_expect_failure ' left alignment formatting with ltrunc. i18n.logOutputEncoding' '
246
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,ltrunc)%s" >actual &&
247
+ qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >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
+
201
256
test_expect_success ' left alignment formatting with mtrunc' '
202
257
git log --pretty="tformat:%<(10,mtrunc)%s" >actual &&
203
258
qz_to_tab_space <<EOF >expected &&
209
264
test_cmp expected actual
210
265
'
211
266
267
+ test_expect_failure ' left alignment formatting with mtrunc. i18n.logOutputEncoding' '
268
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,mtrunc)%s" >actual &&
269
+ qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
270
+ mess.. two
271
+ mess.. one
272
+ add bar Z
273
+ init..lich
274
+ EOF
275
+ test_cmp expected actual
276
+ '
277
+
212
278
test_expect_success ' right alignment formatting' '
213
279
git log --pretty="tformat:%>(40)%s" >actual &&
214
280
qz_to_tab_space <<EOF >expected &&
220
286
test_cmp expected actual
221
287
'
222
288
289
+ test_expect_success ' right alignment formatting. i18n.logOutputEncoding' '
290
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(40)%s" >actual &&
291
+ qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >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
+
223
300
test_expect_success ' right alignment formatting at the nth column' '
224
301
git log --pretty="tformat:%h %>|(40)%s" >actual &&
225
302
qz_to_tab_space <<EOF >expected &&
231
308
test_cmp expected actual
232
309
'
233
310
311
+ test_expect_success ' right alignment formatting at the nth column. i18n.logOutputEncoding' '
312
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %>|(40)%s" >actual &&
313
+ qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >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
+
234
322
test_expect_success ' right alignment formatting with no padding' '
235
323
git log --pretty="tformat:%>(1)%s" >actual &&
236
324
cat <<EOF >expected &&
242
330
test_cmp expected actual
243
331
'
244
332
333
+ test_expect_success ' right alignment formatting with no padding. i18n.logOutputEncoding' '
334
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(1)%s" >actual &&
335
+ cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
336
+ message two
337
+ message one
338
+ add bar
339
+ $(commit_msg)
340
+ EOF
341
+ test_cmp expected actual
342
+ '
343
+
245
344
test_expect_success ' center alignment formatting' '
246
345
git log --pretty="tformat:%><(40)%s" >actual &&
247
346
qz_to_tab_space <<EOF >expected &&
253
352
test_cmp expected actual
254
353
'
255
354
355
+ test_expect_success ' center alignment formatting. i18n.logOutputEncoding' '
356
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(40)%s" >actual &&
357
+ qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
358
+ Z message two Z
359
+ Z message one Z
360
+ Z add bar Z
361
+ Z $(commit_msg) Z
362
+ EOF
363
+ test_cmp expected actual
364
+ '
256
365
test_expect_success ' center alignment formatting at the nth column' '
257
366
git log --pretty="tformat:%h %><|(40)%s" >actual &&
258
367
qz_to_tab_space <<EOF >expected &&
264
373
test_cmp expected actual
265
374
'
266
375
376
+ test_expect_success ' center alignment formatting at the nth column. i18n.logOutputEncoding' '
377
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %><|(40)%s" >actual &&
378
+ qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
379
+ $head1 message two Z
380
+ $head2 message one Z
381
+ $head3 add bar Z
382
+ $head4 $(commit_msg) Z
383
+ EOF
384
+ test_cmp expected actual
385
+ '
386
+
267
387
test_expect_success ' center alignment formatting with no padding' '
268
388
git log --pretty="tformat:%><(1)%s" >actual &&
269
389
cat <<EOF >expected &&
278
398
# save HEAD's SHA-1 digest (with no abbreviations) to use it below
279
399
# as far as the next test amends HEAD
280
400
old_head1=$( git rev-parse --verify HEAD~0)
401
+ test_expect_success ' center alignment formatting with no padding. i18n.logOutputEncoding' '
402
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(1)%s" >actual &&
403
+ cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
404
+ message two
405
+ message one
406
+ add bar
407
+ $(commit_msg)
408
+ EOF
409
+ test_cmp expected actual
410
+ '
281
411
282
412
test_expect_success ' left/right alignment formatting with stealing' '
283
413
git commit --amend -m short --author "long long long <[email protected] >" &&
@@ -290,6 +420,16 @@ initial... A U Thor
290
420
EOF
291
421
test_cmp expected actual
292
422
'
423
+ test_expect_failure ' left/right alignment formatting with stealing. i18n.logOutputEncoding' '
424
+ git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
425
+ cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
426
+ short long long long
427
+ message .. A U Thor
428
+ add bar A U Thor
429
+ initial... A U Thor
430
+ EOF
431
+ test_cmp expected actual
432
+ '
293
433
294
434
# get new digests (with no abbreviations)
295
435
head1=$( git rev-parse --verify HEAD~0) &&
0 commit comments