187
test_cmp expect actual
188
'
189
190
+cat > expect << EOF
191
+=== 804a787 sixth
192
+=== 394ef78 fifth
193
+=== 5d31159 fourth
194
+EOF
195
+test_expect_success 'git log --line-prefix="=== " --no-walk <commits> sorts by commit time' '
196
+ git log --line-prefix="=== " --no-walk --oneline 5d31159 804a787 394ef78 > actual &&
197
+ test_cmp expect actual
198
+'
199
+
200
cat > expect << EOF
201
5d31159 fourth
202
804a787 sixth
294
test_cmp expect actual
295
'
296
297
+cat > expect <<EOF
298
+123 * Second
299
+123 * sixth
300
+123 * fifth
301
+123 * fourth
302
+123 * third
303
+123 * second
304
+123 * initial
305
+EOF
306
+
307
+test_expect_success 'simple log --graph --line-prefix="123 "' '
308
+ git log --graph --line-prefix="123 " --pretty=tformat:%s >actual &&
309
+ test_cmp expect actual
310
+'
311
+
312
test_expect_success 'set up merge history' '
313
git checkout -b side HEAD~4 &&
314
test_commit side-1 1 1 &&
338
test_cmp expect actual
339
'
340
341
+cat > expect <<\EOF
342
+| | | * Merge branch 'side'
343
+| | | |\
344
+| | | | * side-2
345
+| | | | * side-1
346
+| | | * | Second
347
+| | | * | sixth
348
+| | | * | fifth
349
+| | | * | fourth
350
+| | | |/
351
+| | | * third
352
+| | | * second
353
+| | | * initial
354
+EOF
355
+
356
+test_expect_success 'log --graph --line-prefix="| | | " with merge' '
357
+ git log --line-prefix="| | | " --graph --date-order --pretty=tformat:%s |
358
+ sed "s/ *\$//" >actual &&
359
+ test_cmp expect actual
360
+'
361
+
362
test_expect_success 'log --raw --graph -m with merge' '
363
git log --raw --graph --oneline -m master | head -n 500 >actual &&
364
grep "initial" actual
913
test_i18ncmp expect actual.sanitized
914
'
915
916
+cat >expect <<\EOF
917
+*** * commit COMMIT_OBJECT_NAME
918
+*** |\ Merge: MERGE_PARENTS
919
+*** | | Author: A U Thor <author@example.com>
920
+*** | |
921
+*** | | Merge HEADS DESCRIPTION
922
+*** | |
923
+*** | * commit COMMIT_OBJECT_NAME
924
+*** | | Author: A U Thor <author@example.com>
925
+*** | |
926
+*** | | reach
927
+*** | | ---
928
+*** | | reach.t | 1 +
929
+*** | | 1 file changed, 1 insertion(+)
930
+*** | |
931
+*** | | diff --git a/reach.t b/reach.t
932
+*** | | new file mode 100644
933
+*** | | index 0000000..10c9591
934
+*** | | --- /dev/null
935
+*** | | +++ b/reach.t
936
+*** | | @@ -0,0 +1 @@
937
+*** | | +reach
938
+*** | |
939
+*** | \
940
+*** *-. \ commit COMMIT_OBJECT_NAME
941
+*** |\ \ \ Merge: MERGE_PARENTS
942
+*** | | | | Author: A U Thor <author@example.com>
943
+*** | | | |
944
+*** | | | | Merge HEADS DESCRIPTION
945
+*** | | | |
946
+*** | | * | commit COMMIT_OBJECT_NAME
947
+*** | | |/ Author: A U Thor <author@example.com>
948
+*** | | |
949
+*** | | | octopus-b
950
+*** | | | ---
951
+*** | | | octopus-b.t | 1 +
952
+*** | | | 1 file changed, 1 insertion(+)
953
+*** | | |
954
+*** | | | diff --git a/octopus-b.t b/octopus-b.t
955
+*** | | | new file mode 100644
956
+*** | | | index 0000000..d5fcad0
957
+*** | | | --- /dev/null
958
+*** | | | +++ b/octopus-b.t
959
+*** | | | @@ -0,0 +1 @@
960
+*** | | | +octopus-b
961
+*** | | |
962
+*** | * | commit COMMIT_OBJECT_NAME
963
+*** | |/ Author: A U Thor <author@example.com>
964
+*** | |
965
+*** | | octopus-a
966
+*** | | ---
967
+*** | | octopus-a.t | 1 +
968
+*** | | 1 file changed, 1 insertion(+)
969
+*** | |
970
+*** | | diff --git a/octopus-a.t b/octopus-a.t
971
+*** | | new file mode 100644
972
+*** | | index 0000000..11ee015
973
+*** | | --- /dev/null
974
+*** | | +++ b/octopus-a.t
975
+*** | | @@ -0,0 +1 @@
976
+*** | | +octopus-a
977
+*** | |
978
+*** * | commit COMMIT_OBJECT_NAME
979
+*** |/ Author: A U Thor <author@example.com>
980
+*** |
981
+*** | seventh
982
+*** | ---
983
+*** | seventh.t | 1 +
984
+*** | 1 file changed, 1 insertion(+)
985
+*** |
986
+*** | diff --git a/seventh.t b/seventh.t
987
+*** | new file mode 100644
988
+*** | index 0000000..9744ffc
989
+*** | --- /dev/null
990
+*** | +++ b/seventh.t
991
+*** | @@ -0,0 +1 @@
992
+*** | +seventh
993
+*** |
994
+*** * commit COMMIT_OBJECT_NAME
995
+*** |\ Merge: MERGE_PARENTS
996
+*** | | Author: A U Thor <author@example.com>
997
+*** | |
998
+*** | | Merge branch 'tangle'
999
+*** | |
1000
+*** | * commit COMMIT_OBJECT_NAME
1001
+*** | |\ Merge: MERGE_PARENTS
1002
+*** | | | Author: A U Thor <author@example.com>
1003
+*** | | |
1004
+*** | | | Merge branch 'side' (early part) into tangle
1005
+*** | | |
1006
+*** | * | commit COMMIT_OBJECT_NAME
1007
+*** | |\ \ Merge: MERGE_PARENTS
1008
+*** | | | | Author: A U Thor <author@example.com>
1009
+*** | | | |
1010
+*** | | | | Merge branch 'master' (early part) into tangle
1011
+*** | | | |
1012
+*** | * | | commit COMMIT_OBJECT_NAME
1013
+*** | | | | Author: A U Thor <author@example.com>
1014
+*** | | | |
1015
+*** | | | | tangle-a
1016
+*** | | | | ---
1017
+*** | | | | tangle-a | 1 +
1018
+*** | | | | 1 file changed, 1 insertion(+)
1019
+*** | | | |
1020
+*** | | | | diff --git a/tangle-a b/tangle-a
1021
+*** | | | | new file mode 100644
1022
+*** | | | | index 0000000..7898192
1023
+*** | | | | --- /dev/null
1024
+*** | | | | +++ b/tangle-a
1025
+*** | | | | @@ -0,0 +1 @@
1026
+*** | | | | +a
1027
+*** | | | |
1028
+*** * | | | commit COMMIT_OBJECT_NAME
1029
+*** |\ \ \ \ Merge: MERGE_PARENTS
1030
+*** | | | | | Author: A U Thor <author@example.com>
1031
+*** | | | | |
1032
+*** | | | | | Merge branch 'side'
1033
+*** | | | | |
1034
+*** | * | | | commit COMMIT_OBJECT_NAME
1035
+*** | | |_|/ Author: A U Thor <author@example.com>
1036
+*** | |/| |
1037
+*** | | | | side-2
1038
+*** | | | | ---
1039
+*** | | | | 2 | 1 +
1040
+*** | | | | 1 file changed, 1 insertion(+)
1041
+*** | | | |
1042
+*** | | | | diff --git a/2 b/2
1043
+*** | | | | new file mode 100644
1044
+*** | | | | index 0000000..0cfbf08
1045
+*** | | | | --- /dev/null
1046
+*** | | | | +++ b/2
1047
+*** | | | | @@ -0,0 +1 @@
1048
+*** | | | | +2
1049
+*** | | | |
1050
+*** | * | | commit COMMIT_OBJECT_NAME
1051
+*** | | | | Author: A U Thor <author@example.com>
1052
+*** | | | |
1053
+*** | | | | side-1
1054
+*** | | | | ---
1055
+*** | | | | 1 | 1 +
1056
+*** | | | | 1 file changed, 1 insertion(+)
1057
+*** | | | |
1058
+*** | | | | diff --git a/1 b/1
1059
+*** | | | | new file mode 100644
1060
+*** | | | | index 0000000..d00491f
1061
+*** | | | | --- /dev/null
1062
+*** | | | | +++ b/1
1063
+*** | | | | @@ -0,0 +1 @@
1064
+*** | | | | +1
1065
+*** | | | |
1066
+*** * | | | commit COMMIT_OBJECT_NAME
1067
+*** | | | | Author: A U Thor <author@example.com>
1068
+*** | | | |
1069
+*** | | | | Second
1070
+*** | | | | ---
1071
+*** | | | | one | 1 +
1072
+*** | | | | 1 file changed, 1 insertion(+)
1073
+*** | | | |
1074
+*** | | | | diff --git a/one b/one
1075
+*** | | | | new file mode 100644
1076
+*** | | | | index 0000000..9a33383
1077
+*** | | | | --- /dev/null
1078
+*** | | | | +++ b/one
1079
+*** | | | | @@ -0,0 +1 @@
1080
+*** | | | | +case
1081
+*** | | | |
1082
+*** * | | | commit COMMIT_OBJECT_NAME
1083
+*** | |_|/ Author: A U Thor <author@example.com>
1084
+*** |/| |
1085
+*** | | | sixth
1086
+*** | | | ---
1087
+*** | | | a/two | 1 -
1088
+*** | | | 1 file changed, 1 deletion(-)
1089
+*** | | |
1090
+*** | | | diff --git a/a/two b/a/two
1091
+*** | | | deleted file mode 100644
1092
+*** | | | index 9245af5..0000000
1093
+*** | | | --- a/a/two
1094
+*** | | | +++ /dev/null
1095
+*** | | | @@ -1 +0,0 @@
1096
+*** | | | -ni
1097
+*** | | |
1098
+*** * | | commit COMMIT_OBJECT_NAME
1099
+*** | | | Author: A U Thor <author@example.com>
1100
+*** | | |
1101
+*** | | | fifth
1102
+*** | | | ---
1103
+*** | | | a/two | 1 +
1104
+*** | | | 1 file changed, 1 insertion(+)
1105
+*** | | |
1106
+*** | | | diff --git a/a/two b/a/two
1107
+*** | | | new file mode 100644
1108
+*** | | | index 0000000..9245af5
1109
+*** | | | --- /dev/null
1110
+*** | | | +++ b/a/two
1111
+*** | | | @@ -0,0 +1 @@
1112
+*** | | | +ni
1113
+*** | | |
1114
+*** * | | commit COMMIT_OBJECT_NAME
1115
+*** |/ / Author: A U Thor <author@example.com>
1116
+*** | |
1117
+*** | | fourth
1118
+*** | | ---
1119
+*** | | ein | 1 +
1120
+*** | | 1 file changed, 1 insertion(+)
1121
+*** | |
1122
+*** | | diff --git a/ein b/ein
1123
+*** | | new file mode 100644
1124
+*** | | index 0000000..9d7e69f
1125
+*** | | --- /dev/null
1126
+*** | | +++ b/ein
1127
+*** | | @@ -0,0 +1 @@
1128
+*** | | +ichi
1129
+*** | |
1130
+*** * | commit COMMIT_OBJECT_NAME
1131
+*** |/ Author: A U Thor <author@example.com>
1132
+*** |
1133
+*** | third
1134
+*** | ---
1135
+*** | ichi | 1 +
1136
+*** | one | 1 -
1137
+*** | 2 files changed, 1 insertion(+), 1 deletion(-)
1138
+*** |
1139
+*** | diff --git a/ichi b/ichi
1140
+*** | new file mode 100644
1141
+*** | index 0000000..9d7e69f
1142
+*** | --- /dev/null
1143
+*** | +++ b/ichi
1144
+*** | @@ -0,0 +1 @@
1145
+*** | +ichi
1146
+*** | diff --git a/one b/one
1147
+*** | deleted file mode 100644
1148
+*** | index 9d7e69f..0000000
1149
+*** | --- a/one
1150
+*** | +++ /dev/null
1151
+*** | @@ -1 +0,0 @@
1152
+*** | -ichi
1153
+*** |
1154
+*** * commit COMMIT_OBJECT_NAME
1155
+*** | Author: A U Thor <author@example.com>
1156
+*** |
1157
+*** | second
1158
+*** | ---
1159
+*** | one | 2 +-
1160
+*** | 1 file changed, 1 insertion(+), 1 deletion(-)
1161
+*** |
1162
+*** | diff --git a/one b/one
1163
+*** | index 5626abf..9d7e69f 100644
1164
+*** | --- a/one
1165
+*** | +++ b/one
1166
+*** | @@ -1 +1 @@
1167
+*** | -one
1168
+*** | +ichi
1169
+*** |
1170
+*** * commit COMMIT_OBJECT_NAME
1171
+*** Author: A U Thor <author@example.com>
1172
+***
1173
+*** initial
1174
+*** ---
1175
+*** one | 1 +
1176
+*** 1 file changed, 1 insertion(+)
1177
+***
1178
+*** diff --git a/one b/one
1179
+*** new file mode 100644
1180
+*** index 0000000..5626abf
1181
+*** --- /dev/null
1182
+*** +++ b/one
1183
+*** @@ -0,0 +1 @@
1184
+*** +one
1185
+EOF
1186
+
1187
+test_expect_success 'log --line-prefix="*** " --graph with diff and stats' '
1188
+ git log --line-prefix="*** " --no-renames --graph --pretty=short --stat -p >actual &&
1189
+ sanitize_output >actual.sanitized <actual &&
1190
+ test_i18ncmp expect actual.sanitized
1191
+'
1192
+
1193
test_expect_success 'dotdot is a parent directory' '
1194
mkdir -p a/b &&
1195
( echo sixth && echo fifth ) >expect &&