Skip to content

Commit aff2e7c

Browse files
committed
t6003: add --author-date-order test
Tweak the --topo/date-order test vector a bit and mark the author dates of two commits (a2 and a3) earlier than their own committer dates, making them much older than other commits that are made on parallel branches to simulate the case where a long running topic was rebased recently. They will show up as recent in the --date-order output due to their timestamps, but they appear a lot later in the --author-date-order output, even though their committer timestamp says otherwise. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1166731 commit aff2e7c

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

t/t6003-rev-list-topo-order.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ on_dates "00:08" "00:08" as_author [email protected] save_tag b2 unique_commit
2828
on_dates "00:09" "00:09" save_tag b3 unique_commit b3 tree -p b2
2929
on_dates "00:10" "00:10" save_tag c2 unique_commit c2 tree -p c1 -p b2
3030
on_dates "00:11" "00:11" save_tag c3 unique_commit c3 tree -p c2
31-
on_dates "00:12" "00:12" save_tag a2 unique_commit a2 tree -p a1
32-
on_dates "00:13" "00:13" save_tag a3 unique_commit a3 tree -p a2
31+
on_dates "00:12" "00:00" save_tag a2 unique_commit a2 tree -p a1
32+
on_dates "00:13" "00:01" save_tag a3 unique_commit a3 tree -p a2
3333
on_dates "00:14" "00:14" save_tag b4 unique_commit b4 tree -p b3 -p a3
3434
on_dates "00:15" "00:15" save_tag a4 unique_commit a4 tree -p a3 -p b4 -p c3
3535
on_dates "00:16" "00:16" save_tag l3 unique_commit l3 tree -p a4
@@ -122,6 +122,28 @@ l0
122122
root
123123
EOF
124124

125+
test_output_expect_success 'simple author-date order' 'git rev-list --author-date-order HEAD' <<EOF
126+
l5
127+
l4
128+
l3
129+
a4
130+
b4
131+
c3
132+
c2
133+
b3
134+
b2
135+
c1
136+
b1
137+
a3
138+
a2
139+
a1
140+
a0
141+
l2
142+
l1
143+
l0
144+
root
145+
EOF
146+
125147
test_output_expect_success 'two diamonds topo order (g6)' 'git rev-list --topo-order g4' <<EOF
126148
g4
127149
h2

0 commit comments

Comments
 (0)