Skip to content

Commit c82134a

Browse files
ashumkingitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ee3efaf commit c82134a

File tree

1 file changed

+13
-39
lines changed

1 file changed

+13
-39
lines changed

t/t4205-log-pretty-formats.sh

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ test_expect_success 'setup more commits' '
144144
'
145145

146146
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 &&
150148
qz_to_tab_space <<EOF >expected &&
151149
message two Z
152150
message one Z
@@ -157,9 +155,7 @@ EOF
157155
'
158156

159157
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 &&
163159
qz_to_tab_space <<EOF >expected &&
164160
$head1 message two Z
165161
$head2 message one Z
@@ -170,9 +166,7 @@ EOF
170166
'
171167

172168
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 &&
176170
cat <<EOF >expected &&
177171
message two
178172
message one
@@ -183,9 +177,7 @@ EOF
183177
'
184178

185179
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 &&
189181
qz_to_tab_space <<EOF >expected &&
190182
message ..
191183
message ..
@@ -196,9 +188,7 @@ EOF
196188
'
197189

198190
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 &&
202192
qz_to_tab_space <<EOF >expected &&
203193
..sage two
204194
..sage one
@@ -209,9 +199,7 @@ EOF
209199
'
210200

211201
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 &&
215203
qz_to_tab_space <<EOF >expected &&
216204
mess.. two
217205
mess.. one
@@ -222,9 +210,7 @@ EOF
222210
'
223211

224212
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 &&
228214
qz_to_tab_space <<EOF >expected &&
229215
Z message two
230216
Z message one
@@ -235,9 +221,7 @@ EOF
235221
'
236222

237223
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 &&
241225
qz_to_tab_space <<EOF >expected &&
242226
$head1 message two
243227
$head2 message one
@@ -248,9 +232,7 @@ EOF
248232
'
249233

250234
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 &&
254236
cat <<EOF >expected &&
255237
message two
256238
message one
@@ -261,9 +243,7 @@ EOF
261243
'
262244

263245
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 &&
267247
qz_to_tab_space <<EOF >expected &&
268248
Z message two Z
269249
Z message one Z
@@ -274,9 +254,7 @@ EOF
274254
'
275255

276256
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 &&
280258
qz_to_tab_space <<EOF >expected &&
281259
$head1 message two Z
282260
$head2 message one Z
@@ -287,9 +265,7 @@ EOF
287265
'
288266

289267
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 &&
293269
cat <<EOF >expected &&
294270
message two
295271
message one
@@ -305,9 +281,7 @@ old_head1=$(git rev-parse --verify HEAD~0)
305281

306282
test_expect_success 'left/right alignment formatting with stealing' '
307283
git commit --amend -m short --author "long long long <[email protected]>" &&
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 &&
311285
cat <<EOF >expected &&
312286
short long long long
313287
message .. A U Thor

0 commit comments

Comments
 (0)