t4014: use indentable here-docs

The convention is to use indentable here-docs within test cases so that the here-docs line up with the rest of the code within the test case. Change here-docs from `<<\EOF` to `<<-\EOF` so that they can be indented along with the rest of the test case. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Aug 27, 2019 at 00:05 UTC 460609cbd588dce0a5000fc4fae0138d0164e03d
1 file changed +184 -184
t/t4014-format-patch.sh
+184 -184
@@ -1211,282 +1211,282 @@ append_signoff()
1211
1212 test_expect_success 'signoff: commit with no body' '
1213 append_signoff </dev/null >actual &&
1214 - cat <<\EOF | sed "s/EOL$//" >expect &&
1215 -4:Subject: [PATCH] EOL
1216 -8:
1217 -9:Signed-off-by: C O Mitter <committer@example.com>
1218 -EOF
1214 + cat <<-\EOF | sed "s/EOL$//" >expect &&
1215 + 4:Subject: [PATCH] EOL
1216 + 8:
1217 + 9:Signed-off-by: C O Mitter <committer@example.com>
1218 + EOF
1219 test_cmp expect actual
1220 '
1221
1222 test_expect_success 'signoff: commit with only subject' '
1223 echo subject | append_signoff >actual &&
1224 - cat >expect <<\EOF &&
1225 -4:Subject: [PATCH] subject
1226 -8:
1227 -9:Signed-off-by: C O Mitter <committer@example.com>
1228 -EOF
1224 + cat >expect <<-\EOF &&
1225 + 4:Subject: [PATCH] subject
1226 + 8:
1227 + 9:Signed-off-by: C O Mitter <committer@example.com>
1228 + EOF
1229 test_cmp expect actual
1230 '
1231
1232 test_expect_success 'signoff: commit with only subject that does not end with NL' '
1233 printf subject | append_signoff >actual &&
1234 - cat >expect <<\EOF &&
1235 -4:Subject: [PATCH] subject
1236 -8:
1237 -9:Signed-off-by: C O Mitter <committer@example.com>
1238 -EOF
1234 + cat >expect <<-\EOF &&
1235 + 4:Subject: [PATCH] subject
1236 + 8:
1237 + 9:Signed-off-by: C O Mitter <committer@example.com>
1238 + EOF
1239 test_cmp expect actual
1240 '
1241
1242 test_expect_success 'signoff: no existing signoffs' '
1243 - append_signoff <<\EOF >actual &&
1244 -subject
1243 + append_signoff <<-\EOF >actual &&
1244 + subject
1245
1246 -body
1247 -EOF
1248 - cat >expect <<\EOF &&
1249 -4:Subject: [PATCH] subject
1250 -8:
1251 -10:
1252 -11:Signed-off-by: C O Mitter <committer@example.com>
1253 -EOF
1246 + body
1247 + EOF
1248 + cat >expect <<-\EOF &&
1249 + 4:Subject: [PATCH] subject
1250 + 8:
1251 + 10:
1252 + 11:Signed-off-by: C O Mitter <committer@example.com>
1253 + EOF
1254 test_cmp expect actual
1255 '
1256
1257 test_expect_success 'signoff: no existing signoffs and no trailing NL' '
1258 printf "subject\n\nbody" | append_signoff >actual &&
1259 - cat >expect <<\EOF &&
1260 -4:Subject: [PATCH] subject
1261 -8:
1262 -10:
1263 -11:Signed-off-by: C O Mitter <committer@example.com>
1264 -EOF
1259 + cat >expect <<-\EOF &&
1260 + 4:Subject: [PATCH] subject
1261 + 8:
1262 + 10:
1263 + 11:Signed-off-by: C O Mitter <committer@example.com>
1264 + EOF
1265 test_cmp expect actual
1266 '
1267
1268 test_expect_success 'signoff: some random signoff' '
1269 - append_signoff <<\EOF >actual &&
1270 -subject
1269 + append_signoff <<-\EOF >actual &&
1270 + subject
1271
1272 -body
1272 + body
1273
1274 -Signed-off-by: my@house
1275 -EOF
1276 - cat >expect <<\EOF &&
1277 -4:Subject: [PATCH] subject
1278 -8:
1279 -10:
1280 -11:Signed-off-by: my@house
1281 -12:Signed-off-by: C O Mitter <committer@example.com>
1282 -EOF
1274 + Signed-off-by: my@house
1275 + EOF
1276 + cat >expect <<-\EOF &&
1277 + 4:Subject: [PATCH] subject
1278 + 8:
1279 + 10:
1280 + 11:Signed-off-by: my@house
1281 + 12:Signed-off-by: C O Mitter <committer@example.com>
1282 + EOF
1283 test_cmp expect actual
1284 '
1285
1286 test_expect_success 'signoff: misc conforming footer elements' '
1287 - append_signoff <<\EOF >actual &&
1288 -subject
1287 + append_signoff <<-\EOF >actual &&
1288 + subject
1289
1290 -body
1290 + body
1291
1292 -Signed-off-by: my@house
1293 -(cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709)
1294 -Tested-by: Some One <someone@example.com>
1295 -Bug: 1234
1296 -EOF
1297 - cat >expect <<\EOF &&
1298 -4:Subject: [PATCH] subject
1299 -8:
1300 -10:
1301 -11:Signed-off-by: my@house
1302 -15:Signed-off-by: C O Mitter <committer@example.com>
1303 -EOF
1292 + Signed-off-by: my@house
1293 + (cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709)
1294 + Tested-by: Some One <someone@example.com>
1295 + Bug: 1234
1296 + EOF
1297 + cat >expect <<-\EOF &&
1298 + 4:Subject: [PATCH] subject
1299 + 8:
1300 + 10:
1301 + 11:Signed-off-by: my@house
1302 + 15:Signed-off-by: C O Mitter <committer@example.com>
1303 + EOF
1304 test_cmp expect actual
1305 '
1306
1307 test_expect_success 'signoff: some random signoff-alike' '
1308 - append_signoff <<\EOF >actual &&
1309 -subject
1308 + append_signoff <<-\EOF >actual &&
1309 + subject
1310
1311 -body
1312 -Fooled-by-me: my@house
1313 -EOF
1314 - cat >expect <<\EOF &&
1315 -4:Subject: [PATCH] subject
1316 -8:
1317 -11:
1318 -12:Signed-off-by: C O Mitter <committer@example.com>
1319 -EOF
1311 + body
1312 + Fooled-by-me: my@house
1313 + EOF
1314 + cat >expect <<-\EOF &&
1315 + 4:Subject: [PATCH] subject
1316 + 8:
1317 + 11:
1318 + 12:Signed-off-by: C O Mitter <committer@example.com>
1319 + EOF
1320 test_cmp expect actual
1321 '
1322
1323 test_expect_success 'signoff: not really a signoff' '
1324 - append_signoff <<\EOF >actual &&
1325 -subject
1324 + append_signoff <<-\EOF >actual &&
1325 + subject
1326
1327 -I want to mention about Signed-off-by: here.
1328 -EOF
1329 - cat >expect <<\EOF &&
1330 -4:Subject: [PATCH] subject
1331 -8:
1332 -9:I want to mention about Signed-off-by: here.
1333 -10:
1334 -11:Signed-off-by: C O Mitter <committer@example.com>
1335 -EOF
1327 + I want to mention about Signed-off-by: here.
1328 + EOF
1329 + cat >expect <<-\EOF &&
1330 + 4:Subject: [PATCH] subject
1331 + 8:
1332 + 9:I want to mention about Signed-off-by: here.
1333 + 10:
1334 + 11:Signed-off-by: C O Mitter <committer@example.com>
1335 + EOF
1336 test_cmp expect actual
1337 '
1338
1339 test_expect_success 'signoff: not really a signoff (2)' '
1340 - append_signoff <<\EOF >actual &&
1341 -subject
1340 + append_signoff <<-\EOF >actual &&
1341 + subject
1342
1343 -My unfortunate
1344 -Signed-off-by: example happens to be wrapped here.
1345 -EOF
1346 - cat >expect <<\EOF &&
1347 -4:Subject: [PATCH] subject
1348 -8:
1349 -10:Signed-off-by: example happens to be wrapped here.
1350 -11:Signed-off-by: C O Mitter <committer@example.com>
1351 -EOF
1343 + My unfortunate
1344 + Signed-off-by: example happens to be wrapped here.
1345 + EOF
1346 + cat >expect <<-\EOF &&
1347 + 4:Subject: [PATCH] subject
1348 + 8:
1349 + 10:Signed-off-by: example happens to be wrapped here.
1350 + 11:Signed-off-by: C O Mitter <committer@example.com>
1351 + EOF
1352 test_cmp expect actual
1353 '
1354
1355 test_expect_success 'signoff: valid S-o-b paragraph in the middle' '
1356 - append_signoff <<\EOF >actual &&
1357 -subject
1356 + append_signoff <<-\EOF >actual &&
1357 + subject
1358
1359 -Signed-off-by: my@house
1360 -Signed-off-by: your@house
1359 + Signed-off-by: my@house
1360 + Signed-off-by: your@house
1361
1362 -A lot of houses.
1363 -EOF
1364 - cat >expect <<\EOF &&
1365 -4:Subject: [PATCH] subject
1366 -8:
1367 -9:Signed-off-by: my@house
1368 -10:Signed-off-by: your@house
1369 -11:
1370 -13:
1371 -14:Signed-off-by: C O Mitter <committer@example.com>
1372 -EOF
1362 + A lot of houses.
1363 + EOF
1364 + cat >expect <<-\EOF &&
1365 + 4:Subject: [PATCH] subject
1366 + 8:
1367 + 9:Signed-off-by: my@house
1368 + 10:Signed-off-by: your@house
1369 + 11:
1370 + 13:
1371 + 14:Signed-off-by: C O Mitter <committer@example.com>
1372 + EOF
1373 test_cmp expect actual
1374 '
1375
1376 test_expect_success 'signoff: the same signoff at the end' '
1377 - append_signoff <<\EOF >actual &&
1378 -subject
1377 + append_signoff <<-\EOF >actual &&
1378 + subject
1379
1380 -body
1380 + body
1381
1382 -Signed-off-by: C O Mitter <committer@example.com>
1383 -EOF
1384 - cat >expect <<\EOF &&
1385 -4:Subject: [PATCH] subject
1386 -8:
1387 -10:
1388 -11:Signed-off-by: C O Mitter <committer@example.com>
1389 -EOF
1382 + Signed-off-by: C O Mitter <committer@example.com>
1383 + EOF
1384 + cat >expect <<-\EOF &&
1385 + 4:Subject: [PATCH] subject
1386 + 8:
1387 + 10:
1388 + 11:Signed-off-by: C O Mitter <committer@example.com>
1389 + EOF
1390 test_cmp expect actual
1391 '
1392
1393 test_expect_success 'signoff: the same signoff at the end, no trailing NL' '
1394 printf "subject\n\nSigned-off-by: C O Mitter <committer@example.com>" |
1395 append_signoff >actual &&
1396 - cat >expect <<\EOF &&
1397 -4:Subject: [PATCH] subject
1398 -8:
1399 -9:Signed-off-by: C O Mitter <committer@example.com>
1400 -EOF
1396 + cat >expect <<-\EOF &&
1397 + 4:Subject: [PATCH] subject
1398 + 8:
1399 + 9:Signed-off-by: C O Mitter <committer@example.com>
1400 + EOF
1401 test_cmp expect actual
1402 '
1403
1404 test_expect_success 'signoff: the same signoff NOT at the end' '
1405 - append_signoff <<\EOF >actual &&
1406 -subject
1405 + append_signoff <<-\EOF >actual &&
1406 + subject
1407
1408 -body
1408 + body
1409
1410 -Signed-off-by: C O Mitter <committer@example.com>
1411 -Signed-off-by: my@house
1412 -EOF
1413 - cat >expect <<\EOF &&
1414 -4:Subject: [PATCH] subject
1415 -8:
1416 -10:
1417 -11:Signed-off-by: C O Mitter <committer@example.com>
1418 -12:Signed-off-by: my@house
1419 -EOF
1410 + Signed-off-by: C O Mitter <committer@example.com>
1411 + Signed-off-by: my@house
1412 + EOF
1413 + cat >expect <<-\EOF &&
1414 + 4:Subject: [PATCH] subject
1415 + 8:
1416 + 10:
1417 + 11:Signed-off-by: C O Mitter <committer@example.com>
1418 + 12:Signed-off-by: my@house
1419 + EOF
1420 test_cmp expect actual
1421 '
1422
1423 test_expect_success 'signoff: tolerate garbage in conforming footer' '
1424 - append_signoff <<\EOF >actual &&
1425 -subject
1424 + append_signoff <<-\EOF >actual &&
1425 + subject
1426
1427 -body
1427 + body
1428
1429 -Tested-by: my@house
1430 -Some Trash
1431 -Signed-off-by: C O Mitter <committer@example.com>
1432 -EOF
1433 - cat >expect <<\EOF &&
1434 -4:Subject: [PATCH] subject
1435 -8:
1436 -10:
1437 -13:Signed-off-by: C O Mitter <committer@example.com>
1438 -EOF
1429 + Tested-by: my@house
1430 + Some Trash
1431 + Signed-off-by: C O Mitter <committer@example.com>
1432 + EOF
1433 + cat >expect <<-\EOF &&
1434 + 4:Subject: [PATCH] subject
1435 + 8:
1436 + 10:
1437 + 13:Signed-off-by: C O Mitter <committer@example.com>
1438 + EOF
1439 test_cmp expect actual
1440 '
1441
1442 test_expect_success 'signoff: respect trailer config' '
1443 - append_signoff <<\EOF >actual &&
1444 -subject
1443 + append_signoff <<-\EOF >actual &&
1444 + subject
1445
1446 -Myfooter: x
1447 -Some Trash
1448 -EOF
1449 - cat >expect <<\EOF &&
1450 -4:Subject: [PATCH] subject
1451 -8:
1452 -11:
1453 -12:Signed-off-by: C O Mitter <committer@example.com>
1454 -EOF
1446 + Myfooter: x
1447 + Some Trash
1448 + EOF
1449 + cat >expect <<-\EOF &&
1450 + 4:Subject: [PATCH] subject
1451 + 8:
1452 + 11:
1453 + 12:Signed-off-by: C O Mitter <committer@example.com>
1454 + EOF
1455 test_cmp expect actual &&
1456
1457 test_config trailer.Myfooter.ifexists add &&
1458 - append_signoff <<\EOF >actual &&
1459 -subject
1458 + append_signoff <<-\EOF >actual &&
1459 + subject
1460
1461 -Myfooter: x
1462 -Some Trash
1463 -EOF
1464 - cat >expect <<\EOF &&
1465 -4:Subject: [PATCH] subject
1466 -8:
1467 -11:Signed-off-by: C O Mitter <committer@example.com>
1468 -EOF
1461 + Myfooter: x
1462 + Some Trash
1463 + EOF
1464 + cat >expect <<-\EOF &&
1465 + 4:Subject: [PATCH] subject
1466 + 8:
1467 + 11:Signed-off-by: C O Mitter <committer@example.com>
1468 + EOF
1469 test_cmp expect actual
1470 '
1471
1472 test_expect_success 'signoff: footer begins with non-signoff without @ sign' '
1473 - append_signoff <<\EOF >actual &&
1474 -subject
1473 + append_signoff <<-\EOF >actual &&
1474 + subject
1475
1476 -body
1476 + body
1477
1478 -Reviewed-id: Noone
1479 -Tested-by: my@house
1480 -Change-id: Ideadbeef
1481 -Signed-off-by: C O Mitter <committer@example.com>
1482 -Bug: 1234
1483 -EOF
1484 - cat >expect <<\EOF &&
1485 -4:Subject: [PATCH] subject
1486 -8:
1487 -10:
1488 -14:Signed-off-by: C O Mitter <committer@example.com>
1489 -EOF
1478 + Reviewed-id: Noone
1479 + Tested-by: my@house
1480 + Change-id: Ideadbeef
1481 + Signed-off-by: C O Mitter <committer@example.com>
1482 + Bug: 1234
1483 + EOF
1484 + cat >expect <<-\EOF &&
1485 + 4:Subject: [PATCH] subject
1486 + 8:
1487 + 10:
1488 + 14:Signed-off-by: C O Mitter <committer@example.com>
1489 + EOF
1490 test_cmp expect actual
1491 '
1492