3
3
test_description=' git log --graph of skewed left octopus merge.'
4
4
5
5
. ./test-lib.sh
6
+ . " $TEST_DIRECTORY " /lib-log-graph.sh
6
7
7
8
test_expect_success ' set up merge history' '
8
9
test_commit initial &&
@@ -24,7 +25,7 @@ test_expect_success 'set up merge history' '
24
25
'
25
26
26
27
test_expect_success ' log --graph with tricky octopus merge, no color' '
27
- cat >expect.uncolored <<-\EOF &&
28
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order left octopus-merge <<-\EOF
28
29
* left
29
30
| *-. octopus-merge
30
31
|/|\ \
@@ -37,14 +38,11 @@ test_expect_success 'log --graph with tricky octopus merge, no color' '
37
38
|/
38
39
* initial
39
40
EOF
40
- git log --color=never --graph --date-order --pretty=tformat:%s left octopus-merge >actual.raw &&
41
- sed "s/ *\$//" actual.raw >actual &&
42
- test_cmp expect.uncolored actual
43
41
'
44
42
45
43
test_expect_success ' log --graph with tricky octopus merge with colors' '
46
44
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
47
- cat >expect.colors <<-\EOF &&
45
+ test_cmp_colored_graph --pretty=tformat:%s --date-order left octopus-merge <<-\EOF
48
46
* left
49
47
<RED>|<RESET> *<MAGENTA>-<RESET><MAGENTA>.<RESET> octopus-merge
50
48
<RED>|<RESET><RED>/<RESET><YELLOW>|<RESET><BLUE>\<RESET> <MAGENTA>\<RESET>
@@ -57,16 +55,13 @@ test_expect_success 'log --graph with tricky octopus merge with colors' '
57
55
<MAGENTA>|<RESET><MAGENTA>/<RESET>
58
56
* initial
59
57
EOF
60
- git log --color=always --graph --date-order --pretty=tformat:%s left octopus-merge >actual.colors.raw &&
61
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
62
- test_cmp expect.colors actual.colors
63
58
'
64
59
65
60
# Repeat the previous two tests with "normal" octopus merge (i.e.,
66
61
# without the first parent skewing to the "left" branch column).
67
62
68
63
test_expect_success ' log --graph with normal octopus merge, no color' '
69
- cat >expect.uncolored <<-\EOF &&
64
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order octopus-merge <<-\EOF
70
65
*---. octopus-merge
71
66
|\ \ \
72
67
| | | * 4
@@ -78,13 +73,11 @@ test_expect_success 'log --graph with normal octopus merge, no color' '
78
73
|/
79
74
* initial
80
75
EOF
81
- git log --color=never --graph --date-order --pretty=tformat:%s octopus-merge >actual.raw &&
82
- sed "s/ *\$//" actual.raw >actual &&
83
- test_cmp expect.uncolored actual
84
76
'
85
77
86
78
test_expect_success ' log --graph with normal octopus merge with colors' '
87
- cat >expect.colors <<-\EOF &&
79
+ test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
80
+ test_cmp_colored_graph --pretty=tformat:%s --date-order octopus-merge <<-\EOF
88
81
*<YELLOW>-<RESET><YELLOW>-<RESET><BLUE>-<RESET><BLUE>.<RESET> octopus-merge
89
82
<RED>|<RESET><GREEN>\<RESET> <YELLOW>\<RESET> <BLUE>\<RESET>
90
83
<RED>|<RESET> <GREEN>|<RESET> <YELLOW>|<RESET> * 4
@@ -96,14 +89,10 @@ test_expect_success 'log --graph with normal octopus merge with colors' '
96
89
<BLUE>|<RESET><BLUE>/<RESET>
97
90
* initial
98
91
EOF
99
- test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
100
- git log --color=always --graph --date-order --pretty=tformat:%s octopus-merge >actual.colors.raw &&
101
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
102
- test_cmp expect.colors actual.colors
103
92
'
104
93
105
94
test_expect_success ' log --graph with normal octopus merge and child, no color' '
106
- cat >expect.uncolored <<-\EOF &&
95
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order after-merge <<-\EOF
107
96
* after-merge
108
97
*---. octopus-merge
109
98
|\ \ \
@@ -116,13 +105,11 @@ test_expect_success 'log --graph with normal octopus merge and child, no color'
116
105
|/
117
106
* initial
118
107
EOF
119
- git log --color=never --graph --date-order --pretty=tformat:%s after-merge >actual.raw &&
120
- sed "s/ *\$//" actual.raw >actual &&
121
- test_cmp expect.uncolored actual
122
108
'
123
109
124
110
test_expect_success ' log --graph with normal octopus and child merge with colors' '
125
- cat >expect.colors <<-\EOF &&
111
+ test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
112
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-merge <<-\EOF
126
113
* after-merge
127
114
*<BLUE>-<RESET><BLUE>-<RESET><MAGENTA>-<RESET><MAGENTA>.<RESET> octopus-merge
128
115
<GREEN>|<RESET><YELLOW>\<RESET> <BLUE>\<RESET> <MAGENTA>\<RESET>
@@ -135,14 +122,10 @@ test_expect_success 'log --graph with normal octopus and child merge with colors
135
122
<MAGENTA>|<RESET><MAGENTA>/<RESET>
136
123
* initial
137
124
EOF
138
- test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
139
- git log --color=always --graph --date-order --pretty=tformat:%s after-merge >actual.colors.raw &&
140
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
141
- test_cmp expect.colors actual.colors
142
125
'
143
126
144
127
test_expect_success ' log --graph with tricky octopus merge and its child, no color' '
145
- cat >expect.uncolored <<-\EOF &&
128
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order left after-merge <<-\EOF
146
129
* left
147
130
| * after-merge
148
131
| *-. octopus-merge
@@ -156,14 +139,10 @@ test_expect_success 'log --graph with tricky octopus merge and its child, no col
156
139
|/
157
140
* initial
158
141
EOF
159
- git log --color=never --graph --date-order --pretty=tformat:%s left after-merge >actual.raw &&
160
- sed "s/ *\$//" actual.raw >actual &&
161
- test_cmp expect.uncolored actual
162
142
'
163
143
164
144
test_expect_success ' log --graph with tricky octopus merge and its child with colors' '
165
- test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
166
- cat >expect.colors <<-\EOF &&
145
+ test_cmp_colored_graph --pretty=tformat:%s --date-order left after-merge <<-\EOF
167
146
* left
168
147
<RED>|<RESET> * after-merge
169
148
<RED>|<RESET> *<CYAN>-<RESET><CYAN>.<RESET> octopus-merge
@@ -177,13 +156,10 @@ test_expect_success 'log --graph with tricky octopus merge and its child with co
177
156
<CYAN>|<RESET><CYAN>/<RESET>
178
157
* initial
179
158
EOF
180
- git log --color=always --graph --date-order --pretty=tformat:%s left after-merge >actual.colors.raw &&
181
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
182
- test_cmp expect.colors actual.colors
183
159
'
184
160
185
161
test_expect_success ' log --graph with crossover in octopus merge, no color' '
186
- cat >expect.uncolored <<-\EOF &&
162
+ test_cmp_graph --pretty=tformat:%s --date-order after-4 octopus-merge <<-\EOF
187
163
* after-4
188
164
| *---. octopus-merge
189
165
| |\ \ \
@@ -200,14 +176,11 @@ test_expect_success 'log --graph with crossover in octopus merge, no color' '
200
176
|/
201
177
* initial
202
178
EOF
203
- git log --color=never --graph --date-order --pretty=tformat:%s after-4 octopus-merge >actual.raw &&
204
- sed "s/ *\$//" actual.raw >actual &&
205
- test_cmp expect.uncolored actual
206
179
'
207
180
208
181
test_expect_success ' log --graph with crossover in octopus merge with colors' '
209
182
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
210
- cat >expect.colors <<-\EOF &&
183
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-4 octopus-merge <<-\EOF
211
184
* after-4
212
185
<RED>|<RESET> *<BLUE>-<RESET><BLUE>-<RESET><RED>-<RESET><RED>.<RESET> octopus-merge
213
186
<RED>|<RESET> <GREEN>|<RESET><YELLOW>\<RESET> <BLUE>\<RESET> <RED>\<RESET>
@@ -224,13 +197,10 @@ test_expect_success 'log --graph with crossover in octopus merge with colors' '
224
197
<MAGENTA>|<RESET><MAGENTA>/<RESET>
225
198
* initial
226
199
EOF
227
- git log --color=always --graph --date-order --pretty=tformat:%s after-4 octopus-merge >actual.colors.raw &&
228
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
229
- test_cmp expect.colors actual.colors
230
200
'
231
201
232
202
test_expect_success ' log --graph with crossover in octopus merge and its child, no color' '
233
- cat >expect.uncolored <<-\EOF &&
203
+ test_cmp_graph --pretty=tformat:%s --date-order after-4 after-merge <<-\EOF
234
204
* after-4
235
205
| * after-merge
236
206
| *---. octopus-merge
@@ -248,14 +218,11 @@ test_expect_success 'log --graph with crossover in octopus merge and its child,
248
218
|/
249
219
* initial
250
220
EOF
251
- git log --color=never --graph --date-order --pretty=tformat:%s after-4 after-merge >actual.raw &&
252
- sed "s/ *\$//" actual.raw >actual &&
253
- test_cmp expect.uncolored actual
254
221
'
255
222
256
223
test_expect_success ' log --graph with crossover in octopus merge and its child with colors' '
257
224
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
258
- cat >expect.colors <<-\EOF &&
225
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-4 after-merge <<-\EOF
259
226
* after-4
260
227
<RED>|<RESET> * after-merge
261
228
<RED>|<RESET> *<MAGENTA>-<RESET><MAGENTA>-<RESET><RED>-<RESET><RED>.<RESET> octopus-merge
@@ -273,13 +240,10 @@ test_expect_success 'log --graph with crossover in octopus merge and its child w
273
240
<CYAN>|<RESET><CYAN>/<RESET>
274
241
* initial
275
242
EOF
276
- git log --color=always --graph --date-order --pretty=tformat:%s after-4 after-merge >actual.colors.raw &&
277
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
278
- test_cmp expect.colors actual.colors
279
243
'
280
244
281
245
test_expect_success ' log --graph with unrelated commit and octopus tip, no color' '
282
- cat >expect.uncolored <<-\EOF &&
246
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order --pretty=tformat:%s after-initial octopus-merge <<-\EOF
283
247
* after-initial
284
248
| *---. octopus-merge
285
249
| |\ \ \
@@ -296,14 +260,11 @@ test_expect_success 'log --graph with unrelated commit and octopus tip, no color
296
260
|/
297
261
* initial
298
262
EOF
299
- git log --color=never --graph --date-order --pretty=tformat:%s after-initial octopus-merge >actual.raw &&
300
- sed "s/ *\$//" actual.raw >actual &&
301
- test_cmp expect.uncolored actual
302
263
'
303
264
304
265
test_expect_success ' log --graph with unrelated commit and octopus tip with colors' '
305
266
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
306
- cat >expect.colors <<-\EOF &&
267
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-initial octopus-merge <<-\EOF
307
268
* after-initial
308
269
<RED>|<RESET> *<BLUE>-<RESET><BLUE>-<RESET><MAGENTA>-<RESET><MAGENTA>.<RESET> octopus-merge
309
270
<RED>|<RESET> <GREEN>|<RESET><YELLOW>\<RESET> <BLUE>\<RESET> <MAGENTA>\<RESET>
@@ -320,13 +281,10 @@ test_expect_success 'log --graph with unrelated commit and octopus tip with colo
320
281
<RED>|<RESET><RED>/<RESET>
321
282
* initial
322
283
EOF
323
- git log --color=always --graph --date-order --pretty=tformat:%s after-initial octopus-merge >actual.colors.raw &&
324
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
325
- test_cmp expect.colors actual.colors
326
284
'
327
285
328
286
test_expect_success ' log --graph with unrelated commit and octopus child, no color' '
329
- cat >expect.uncolored <<-\EOF &&
287
+ test_cmp_graph --pretty=tformat:%s --color=never --date-order after-initial after-merge <<-\EOF
330
288
* after-initial
331
289
| * after-merge
332
290
| *---. octopus-merge
@@ -344,14 +302,11 @@ test_expect_success 'log --graph with unrelated commit and octopus child, no col
344
302
|/
345
303
* initial
346
304
EOF
347
- git log --color=never --graph --date-order --pretty=tformat:%s after-initial after-merge >actual.raw &&
348
- sed "s/ *\$//" actual.raw >actual &&
349
- test_cmp expect.uncolored actual
350
305
'
351
306
352
307
test_expect_success ' log --graph with unrelated commit and octopus child with colors' '
353
308
test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
354
- cat >expect.colors <<-\EOF &&
309
+ test_cmp_colored_graph --pretty=tformat:%s --date-order after-initial after-merge <<-\EOF
355
310
* after-initial
356
311
<RED>|<RESET> * after-merge
357
312
<RED>|<RESET> *<MAGENTA>-<RESET><MAGENTA>-<RESET><CYAN>-<RESET><CYAN>.<RESET> octopus-merge
@@ -369,9 +324,6 @@ test_expect_success 'log --graph with unrelated commit and octopus child with co
369
324
<RED>|<RESET><RED>/<RESET>
370
325
* initial
371
326
EOF
372
- git log --color=always --graph --date-order --pretty=tformat:%s after-initial after-merge >actual.colors.raw &&
373
- test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
374
- test_cmp expect.colors actual.colors
375
327
'
376
328
377
329
test_done
0 commit comments