git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] git rev-list --no-walk A B C sorts by commit date incorrectly

From
Kevin Ballard <kevin@sb.org>
Date
Jan 8, 2011, 03:12 UTC
Message-ID
<BB84A2F6-E6B0-49E4-9DC7-6BA8860623E6@sb.org>
In-Reply-To
<7v62u043ba.fsf@alter.siamese.dyndns.org>
On Jan 7, 2011, at 5:00 PM, Junio C Hamano wrote:
Show 11 quoted lines
> Kevin Ballard <kevin@sb.org> writes:
> 
>> Is there any rationale for this behavior?
> 
> Not a rationale, but an explanation is that most of the time we walk the
> history and sorting by date is the first thing that needs to be done, and
> the --no-walk option was an afterthought that was tucked in.
> 
> I suspect that a three-liner patch to revision.c:prepare_revision_walk()
> would give you what you want.  Instead of calling insert-by-date, you
> append to the tail when revs->no_walk is given, or something.

It almost works, but not quite. My inclination is to say `git rev-list --no-walk A B C` should emit A B C in that order. Implemented this way, `git rev-list --no-walk ^HEAD~3 HEAD` emits commits in the wrong order, and I can't figure out how to change that. If I implement `git rev-list --no-walk A B C` to emit C B A instead, then the test for `git cherry-pick --stdin` fails (t3508), and I don't know why.

-Kevin Ballard
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 7 in “[BUG] git rev-list --no-walk A B C sorts by commit date incorrectly”
  1. Kevin BallardJan 8, 2011
  2. Junio C HamanoJan 8, 2011
  3. Kevin BallardJan 8, 2011
  4. Junio C HamanoJan 8, 2011
  5. Kevin BallardJan 8, 2011
  6. Junio C HamanoJan 9, 2011
  7. Martin von ZweigbergkJan 12, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.