t4205: indent here documents
Our usual style in the test scripts is to indent here documents with tabs, and use "<<-" to strip the tabs. The result is easier to read. This old test script did not do so in its inception, and further tests added onto it followed the local style. Let's bring it in line with our usual style. Some of the tests actually care quite a bit about whitespace, but none of them do so at the beginning of the line (because they use things like qz_to_tab_space to avoid depending on the literal whitespace), so we can do a fairly mechanical conversion. Most of the here-docs also use interpolation, so they have been left as "<<-EOF". In a few cases, though, where interpolation was not in use, I've converted them to "<<-\EOF" to match our usual "don't interpolate unless you need to" style. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
1bd37509ca
commit
9d1ca1dac0
@ -145,7 +145,7 @@ test_expect_success 'setup more commits' '
|
||||
|
||||
test_expect_success 'left alignment formatting' '
|
||||
git log --pretty="tformat:%<(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
message two Z
|
||||
message one Z
|
||||
add bar Z
|
||||
@ -156,7 +156,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
message two Z
|
||||
message one Z
|
||||
add bar Z
|
||||
@ -167,7 +167,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting at the nth column' '
|
||||
git log --pretty="tformat:%h %<|(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
$head1 message two Z
|
||||
$head2 message one Z
|
||||
$head3 add bar Z
|
||||
@ -178,7 +178,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting at the nth column' '
|
||||
COLUMNS=50 git log --pretty="tformat:%h %<|(-10)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
$head1 message two Z
|
||||
$head2 message one Z
|
||||
$head3 add bar Z
|
||||
@ -189,7 +189,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting at the nth column. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %<|(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
$head1 message two Z
|
||||
$head2 message one Z
|
||||
$head3 add bar Z
|
||||
@ -200,7 +200,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting with no padding' '
|
||||
git log --pretty="tformat:%<(1)%s" >actual &&
|
||||
cat <<EOF >expected &&
|
||||
cat <<-EOF >expected &&
|
||||
message two
|
||||
message one
|
||||
add bar
|
||||
@ -211,7 +211,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting with no padding. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(1)%s" >actual &&
|
||||
cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
message two
|
||||
message one
|
||||
add bar
|
||||
@ -222,7 +222,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting with trunc' '
|
||||
git log --pretty="tformat:%<(10,trunc)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-\EOF >expected &&
|
||||
message ..
|
||||
message ..
|
||||
add bar Z
|
||||
@ -233,7 +233,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s" >actual &&
|
||||
qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
message ..
|
||||
message ..
|
||||
add bar Z
|
||||
@ -244,7 +244,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting with ltrunc' '
|
||||
git log --pretty="tformat:%<(10,ltrunc)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
..sage two
|
||||
..sage one
|
||||
add bar Z
|
||||
@ -255,7 +255,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,ltrunc)%s" >actual &&
|
||||
qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
..sage two
|
||||
..sage one
|
||||
add bar Z
|
||||
@ -266,7 +266,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting with mtrunc' '
|
||||
git log --pretty="tformat:%<(10,mtrunc)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-\EOF >expected &&
|
||||
mess.. two
|
||||
mess.. one
|
||||
add bar Z
|
||||
@ -277,7 +277,7 @@ EOF
|
||||
|
||||
test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,mtrunc)%s" >actual &&
|
||||
qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
mess.. two
|
||||
mess.. one
|
||||
add bar Z
|
||||
@ -288,7 +288,7 @@ EOF
|
||||
|
||||
test_expect_success 'right alignment formatting' '
|
||||
git log --pretty="tformat:%>(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
Z message two
|
||||
Z message one
|
||||
Z add bar
|
||||
@ -299,7 +299,7 @@ EOF
|
||||
|
||||
test_expect_success 'right alignment formatting. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
Z message two
|
||||
Z message one
|
||||
Z add bar
|
||||
@ -310,7 +310,7 @@ EOF
|
||||
|
||||
test_expect_success 'right alignment formatting at the nth column' '
|
||||
git log --pretty="tformat:%h %>|(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
$head1 message two
|
||||
$head2 message one
|
||||
$head3 add bar
|
||||
@ -321,7 +321,7 @@ EOF
|
||||
|
||||
test_expect_success 'right alignment formatting at the nth column' '
|
||||
COLUMNS=50 git log --pretty="tformat:%h %>|(-10)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
$head1 message two
|
||||
$head2 message one
|
||||
$head3 add bar
|
||||
@ -332,7 +332,7 @@ EOF
|
||||
|
||||
test_expect_success 'right alignment formatting at the nth column. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %>|(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
$head1 message two
|
||||
$head2 message one
|
||||
$head3 add bar
|
||||
@ -345,7 +345,7 @@ EOF
|
||||
# as in previous test.
|
||||
test_expect_success 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --graph --pretty="tformat:%h %>|(40)%s" >actual &&
|
||||
iconv -f utf-8 -t $test_encoding >expected <<EOF&&
|
||||
iconv -f utf-8 -t $test_encoding >expected <<-EOF &&
|
||||
* $head1 message two
|
||||
* $head2 message one
|
||||
* $head3 add bar
|
||||
@ -356,7 +356,7 @@ EOF
|
||||
|
||||
test_expect_success 'right alignment formatting with no padding' '
|
||||
git log --pretty="tformat:%>(1)%s" >actual &&
|
||||
cat <<EOF >expected &&
|
||||
cat <<-EOF >expected &&
|
||||
message two
|
||||
message one
|
||||
add bar
|
||||
@ -367,7 +367,7 @@ EOF
|
||||
|
||||
test_expect_success 'right alignment formatting with no padding and with --graph' '
|
||||
git log --graph --pretty="tformat:%>(1)%s" >actual &&
|
||||
cat <<EOF >expected &&
|
||||
cat <<-EOF >expected &&
|
||||
* message two
|
||||
* message one
|
||||
* add bar
|
||||
@ -378,7 +378,7 @@ EOF
|
||||
|
||||
test_expect_success 'right alignment formatting with no padding. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(1)%s" >actual &&
|
||||
cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
message two
|
||||
message one
|
||||
add bar
|
||||
@ -389,7 +389,7 @@ EOF
|
||||
|
||||
test_expect_success 'center alignment formatting' '
|
||||
git log --pretty="tformat:%><(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
Z message two Z
|
||||
Z message one Z
|
||||
Z add bar Z
|
||||
@ -400,7 +400,7 @@ EOF
|
||||
|
||||
test_expect_success 'center alignment formatting. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
Z message two Z
|
||||
Z message one Z
|
||||
Z add bar Z
|
||||
@ -410,7 +410,7 @@ EOF
|
||||
'
|
||||
test_expect_success 'center alignment formatting at the nth column' '
|
||||
git log --pretty="tformat:%h %><|(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
$head1 message two Z
|
||||
$head2 message one Z
|
||||
$head3 add bar Z
|
||||
@ -421,7 +421,7 @@ EOF
|
||||
|
||||
test_expect_success 'center alignment formatting at the nth column' '
|
||||
COLUMNS=70 git log --pretty="tformat:%h %><|(-30)%s" >actual &&
|
||||
qz_to_tab_space <<EOF >expected &&
|
||||
qz_to_tab_space <<-EOF >expected &&
|
||||
$head1 message two Z
|
||||
$head2 message one Z
|
||||
$head3 add bar Z
|
||||
@ -432,7 +432,7 @@ EOF
|
||||
|
||||
test_expect_success 'center alignment formatting at the nth column. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %><|(40)%s" >actual &&
|
||||
qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
$head1 message two Z
|
||||
$head2 message one Z
|
||||
$head3 add bar Z
|
||||
@ -443,7 +443,7 @@ EOF
|
||||
|
||||
test_expect_success 'center alignment formatting with no padding' '
|
||||
git log --pretty="tformat:%><(1)%s" >actual &&
|
||||
cat <<EOF >expected &&
|
||||
cat <<-EOF >expected &&
|
||||
message two
|
||||
message one
|
||||
add bar
|
||||
@ -457,7 +457,7 @@ EOF
|
||||
old_head1=$(git rev-parse --verify HEAD~0)
|
||||
test_expect_success 'center alignment formatting with no padding. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(1)%s" >actual &&
|
||||
cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
message two
|
||||
message one
|
||||
add bar
|
||||
@ -469,7 +469,7 @@ EOF
|
||||
test_expect_success 'left/right alignment formatting with stealing' '
|
||||
git commit --amend -m short --author "long long long <long@me.com>" &&
|
||||
git log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
|
||||
cat <<EOF >expected &&
|
||||
cat <<-\EOF >expected &&
|
||||
short long long long
|
||||
message .. A U Thor
|
||||
add bar A U Thor
|
||||
@ -479,7 +479,7 @@ EOF
|
||||
'
|
||||
test_expect_success 'left/right alignment formatting with stealing. i18n.logOutputEncoding' '
|
||||
git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
|
||||
cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
cat <<-\EOF | iconv -f utf-8 -t $test_encoding >expected &&
|
||||
short long long long
|
||||
message .. A U Thor
|
||||
add bar A U Thor
|
||||
@ -515,7 +515,7 @@ test_expect_success 'log decoration properly follows tag chain' '
|
||||
git tag -d tag1 &&
|
||||
git commit --amend -m shorter &&
|
||||
git log --no-walk --tags --pretty="%H %d" --decorate=full >actual &&
|
||||
cat <<EOF >expected &&
|
||||
cat <<-EOF >expected &&
|
||||
$head1 (tag: refs/tags/tag2)
|
||||
$head2 (tag: refs/tags/message-one)
|
||||
$old_head1 (tag: refs/tags/message-two)
|
||||
@ -526,7 +526,7 @@ EOF
|
||||
|
||||
test_expect_success 'clean log decoration' '
|
||||
git log --no-walk --tags --pretty="%H %D" --decorate=full >actual &&
|
||||
cat >expected <<EOF &&
|
||||
cat >expected <<-EOF &&
|
||||
$head1 tag: refs/tags/tag2
|
||||
$head2 tag: refs/tags/message-one
|
||||
$old_head1 tag: refs/tags/message-two
|
||||
|
Loading…
Reference in New Issue
Block a user