Skip to content

Commit d5cee0f

Browse files
Michael J Grubergitster
authored andcommitted
t4202-log.sh: Test git log --no-walk sort order
'git log --no-walk' sorts commits by commit time whereas 'git show' does not (it leaves them as given on the command line). Document this by two tests so that we never forget why ba1d450 (Tentative built-in "git show", 2006-04-15) introduced it and 8e64006 (Teach revision machinery about --no-walk, 2007-07-24) exposed it as an option argument. Signed-off-by: Michael J Gruber <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3de4a44 commit d5cee0f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

t/t4202-log.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,26 @@ test_expect_success 'git log --follow' '
149149
150150
'
151151

152+
cat > expect << EOF
153+
804a787 sixth
154+
394ef78 fifth
155+
5d31159 fourth
156+
EOF
157+
test_expect_success 'git log --no-walk <commits> sorts by commit time' '
158+
git log --no-walk --oneline 5d31159 804a787 394ef78 > actual &&
159+
test_cmp expect actual
160+
'
161+
162+
cat > expect << EOF
163+
5d31159 fourth
164+
804a787 sixth
165+
394ef78 fifth
166+
EOF
167+
test_expect_success 'git show <commits> leaves list of commits as given' '
168+
git show --oneline -s 5d31159 804a787 394ef78 > actual &&
169+
test_cmp expect actual
170+
'
171+
152172
test_expect_success 'setup case sensitivity tests' '
153173
echo case >one &&
154174
test_tick &&

0 commit comments

Comments
 (0)