t4205 (log-pretty-format): use `tformat` rather than `format`
Use `tformat` to avoid using of `echo` to complete end of line. Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexey Shumkin committed
May 21, 2014 at 17:20 UTC
c82134a9f39427139a26cd67b7c2fd13b2e8c357
1 file changed
+13
-39
t/t4205-log-pretty-formats.sh
+13
-39
@@ -144,9 +144,7 @@ test_expect_success 'setup more commits' '
144
'
145
146
test_expect_success 'left alignment formatting' '
147
- git log --pretty="format:%<(40)%s" >actual &&
148
- # complete the incomplete line at the end
149
- echo >>actual &&
147
+ git log --pretty="tformat:%<(40)%s" >actual &&
148
qz_to_tab_space <<EOF >expected &&
149
message two Z
150
message one Z
@@ -157,9 +155,7 @@ EOF
155
'
156
157
test_expect_success 'left alignment formatting at the nth column' '
160
- git log --pretty="format:%h %<|(40)%s" >actual &&
161
- # complete the incomplete line at the end
162
- echo >>actual &&
158
+ git log --pretty="tformat:%h %<|(40)%s" >actual &&
159
qz_to_tab_space <<EOF >expected &&
160
$head1 message two Z
161
$head2 message one Z
@@ -170,9 +166,7 @@ EOF
166
'
167
168
test_expect_success 'left alignment formatting with no padding' '
173
- git log --pretty="format:%<(1)%s" >actual &&
174
- # complete the incomplete line at the end
175
- echo >>actual &&
169
+ git log --pretty="tformat:%<(1)%s" >actual &&
170
cat <<EOF >expected &&
171
message two
172
message one
@@ -183,9 +177,7 @@ EOF
177
'
178
179
test_expect_success 'left alignment formatting with trunc' '
186
- git log --pretty="format:%<(10,trunc)%s" >actual &&
187
- # complete the incomplete line at the end
188
- echo >>actual &&
180
+ git log --pretty="tformat:%<(10,trunc)%s" >actual &&
181
qz_to_tab_space <<EOF >expected &&
182
message ..
183
message ..
@@ -196,9 +188,7 @@ EOF
188
'
189
190
test_expect_success 'left alignment formatting with ltrunc' '
199
- git log --pretty="format:%<(10,ltrunc)%s" >actual &&
200
- # complete the incomplete line at the end
201
- echo >>actual &&
191
+ git log --pretty="tformat:%<(10,ltrunc)%s" >actual &&
192
qz_to_tab_space <<EOF >expected &&
193
..sage two
194
..sage one
@@ -209,9 +199,7 @@ EOF
199
'
200
201
test_expect_success 'left alignment formatting with mtrunc' '
212
- git log --pretty="format:%<(10,mtrunc)%s" >actual &&
213
- # complete the incomplete line at the end
214
- echo >>actual &&
202
+ git log --pretty="tformat:%<(10,mtrunc)%s" >actual &&
203
qz_to_tab_space <<EOF >expected &&
204
mess.. two
205
mess.. one
@@ -222,9 +210,7 @@ EOF
210
'
211
212
test_expect_success 'right alignment formatting' '
225
- git log --pretty="format:%>(40)%s" >actual &&
226
- # complete the incomplete line at the end
227
- echo >>actual &&
213
+ git log --pretty="tformat:%>(40)%s" >actual &&
214
qz_to_tab_space <<EOF >expected &&
215
Z message two
216
Z message one
@@ -235,9 +221,7 @@ EOF
221
'
222
223
test_expect_success 'right alignment formatting at the nth column' '
238
- git log --pretty="format:%h %>|(40)%s" >actual &&
239
- # complete the incomplete line at the end
240
- echo >>actual &&
224
+ git log --pretty="tformat:%h %>|(40)%s" >actual &&
225
qz_to_tab_space <<EOF >expected &&
226
$head1 message two
227
$head2 message one
@@ -248,9 +232,7 @@ EOF
232
'
233
234
test_expect_success 'right alignment formatting with no padding' '
251
- git log --pretty="format:%>(1)%s" >actual &&
252
- # complete the incomplete line at the end
253
- echo >>actual &&
235
+ git log --pretty="tformat:%>(1)%s" >actual &&
236
cat <<EOF >expected &&
237
message two
238
message one
@@ -261,9 +243,7 @@ EOF
243
'
244
245
test_expect_success 'center alignment formatting' '
264
- git log --pretty="format:%><(40)%s" >actual &&
265
- # complete the incomplete line at the end
266
- echo >>actual &&
246
+ git log --pretty="tformat:%><(40)%s" >actual &&
247
qz_to_tab_space <<EOF >expected &&
248
Z message two Z
249
Z message one Z
@@ -274,9 +254,7 @@ EOF
254
'
255
256
test_expect_success 'center alignment formatting at the nth column' '
277
- git log --pretty="format:%h %><|(40)%s" >actual &&
278
- # complete the incomplete line at the end
279
- echo >>actual &&
257
+ git log --pretty="tformat:%h %><|(40)%s" >actual &&
258
qz_to_tab_space <<EOF >expected &&
259
$head1 message two Z
260
$head2 message one Z
@@ -287,9 +265,7 @@ EOF
265
'
266
267
test_expect_success 'center alignment formatting with no padding' '
290
- git log --pretty="format:%><(1)%s" >actual &&
291
- # complete the incomplete line at the end
292
- echo >>actual &&
268
+ git log --pretty="tformat:%><(1)%s" >actual &&
269
cat <<EOF >expected &&
270
message two
271
message one
@@ -305,9 +281,7 @@ old_head1=$(git rev-parse --verify HEAD~0)
281
282
test_expect_success 'left/right alignment formatting with stealing' '
283
git commit --amend -m short --author "long long long <long@me.com>" &&
308
- git log --pretty="format:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
309
- # complete the incomplete line at the end
310
- echo >>actual &&
284
+ git log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual &&
285
cat <<EOF >expected &&
286
short long long long
287
message .. A U Thor