Commit 5853cae
DWIM 'git show -5' to 'git show --do-walk -5'
To show the last two commits with one command, one might try
1) git show -s master~2..
2) git show -s ^master~2 master
3) git show -s master^ master
4) git show -s -2 master
Choice (3) works because both commits are listed on the command line.
Choices (1) and (2) have worked ever since v1.6.4-rc~3 (Make 'git
show' more useful, 2009-07-13) disabled --no-walk in this case because
there is no other useful meaning for them to have. Unfortunately, (4)
does not work: it outputs only one commit, because --no-walk stays on.
So disable --no-walk in this case so ‘git show’ and future ‘git
cherry-pick’ can behave as expected.
As a side effect, this unfortunately changes the meaning of
‘git log --oneline --decorate --no-walk -5 --all’: instead of listing
five refs, after this patch that command would list the five most
recent commits.
Signed-off-by: Jonathan Nieder <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 225c93a commit 5853cae
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
| 1066 | + | |
1066 | 1067 | | |
1067 | 1068 | | |
1068 | 1069 | | |
1069 | 1070 | | |
1070 | 1071 | | |
| 1072 | + | |
1071 | 1073 | | |
1072 | 1074 | | |
1073 | 1075 | | |
1074 | 1076 | | |
| 1077 | + | |
1075 | 1078 | | |
1076 | 1079 | | |
1077 | 1080 | | |
| 1081 | + | |
1078 | 1082 | | |
1079 | 1083 | | |
1080 | 1084 | | |
| |||
0 commit comments