[BUG] git rev-list --no-walk A B C sorts by commit date incorrectly
- From
Kevin Ballard <kevin@sb.org>
- Date
- Jan 8, 2011, 00:19 UTC
- Message-ID
- <CEF26B82-4281-4B8F-A994-DE32EFB92BA7@sb.org>
----------------------------------------------------------------------------- Running the command `git rev-list --no-walk A B C` should be expected to emit the commits in the same order as they were specified. This is especially important as the same machinery is used for `git cherry-pick`, and so saying `git cherry-pick A B C` can be expected to pick A before B, and B before C.
This does not happen.
Instead, it appears to be sorting the given commits according to the commit timestamp. To make matters worse, it's not a stable sort. If commits A and B have the same timestamp (for example, if they were rebased together), then git cherry-pick tends to apply B before A.
Is there any rationale for this behavior? Any place where it makes sense to reorder the commits in this fashion? As far as I'm concerned, typing `git cherry-pick A B C` should behave identically to typing
git cherry-pick A git cherry-pick B git cherry-pick C
regardless of the actual commit dates on A, B, and C.
-Kevin Ballard