git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] git rev-list --no-walk A B C sorts by commit date incorrectly
@ 2011-01-08  0:19 Kevin Ballard
  2011-01-08  1:00 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Ballard @ 2011-01-08  0:19 UTC (permalink / raw)
  To: git list

-----------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-12  0:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-08  0:19 [BUG] git rev-list --no-walk A B C sorts by commit date incorrectly Kevin Ballard
2011-01-08  1:00 ` Junio C Hamano
2011-01-08  3:12   ` Kevin Ballard
2011-01-08  5:41     ` Junio C Hamano
2011-01-08  5:51       ` Kevin Ballard
2011-01-09  6:58       ` Junio C Hamano
2011-01-12  0:54         ` Martin von Zweigbergk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).