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

Re: [PATCH 0/4] Re: cherry-pick and 'log --no-walk' and ordering

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Aug 13, 2012, 16:09 UTC
Message-ID
<CAOeW2eHprw73+zqVbJRird1eE7ayU_KjCUSoieYsGi1rbL5QBQ@mail.gmail.com>
In-Reply-To
<7vhas7fefs.fsf@alter.siamese.dyndns.org>
On Mon, Aug 13, 2012 at 12:17 AM, Junio C Hamano <gitster@pobox.com> wrote:
> y@google.com writes:
>
> [Administrivia: I somehow doubt y@google.com would reach you, and
> futzed with the To: line above]

:-( Sorry, sendemail.from now set. (I apparently answered "y" instead of just <enter> to accept the default.)

> I actually think --no-walk, especially when given any negative
> revision, that sorts is fundamentally a flawed concept (it led to
> the inconsistency that made "git show A..B C" vs "git show C A..B"
> behave differently, which we had to fix recently).
I completely agree.
> Would anything break if we take your patch, but without two
> possibilities to revs->no_walk option (i.e. we never sort under
> no_walk)?  That is, the core of your change would become something
> like this:

I also thought the sorting was just a bug. From what I understand by looking how the code has evolved, the sorting in the no-walk case was not intentional, but more of a consequence of the implementation. That patch you suggested was my first attempt and led me to find the broken cherry-pick test cases that I then fixed in patch 2/4. But, it clearly would break the test case in t4202 called 'git log --no-walk <commits> sorts by commit time'. So I started digging from there and found e.g.

http://thread.gmane.org/gmane.comp.version-control.git/123205/focus=123216

For convenience, I have pasted the commit message of the commit mentioned in that thread at the end of this email. So we would be breaking at least Johannes's use case if we changed it. I would think almost everyone who doesn't already know would expect "git rev-list A B" to list them in that order, so is a migration desired? Or just change the default for --no-walk from "sorted" to "unsorted" in git 2.0?

By the way, git-log's documentation says "By default, the commits are shown in reverse chronological order.", which to some degree is in support of the current behavior.

commit 8e64006eee9c82eba513b98306c179c9e2385e4e
Author: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Date:   Tue Jul 24 00:38:40 2007 +0100
    Teach revision machinery about --no-walk
    The flag "no_walk" is present in struct rev_info since a long time, but
    so far has been in use exclusively by "git show".
    With this flag, you can see all your refs, ordered by date of the last
    commit:
    $ git log --abbrev-commit --pretty=oneline --decorate --all --no-walk
    which is extremely helpful if you have to juggle with a lot topic
    branches, and do not remember in which one you introduced that uber
    debug option, or simply want to get an overview what is cooking.
    (Note that the "git log" invocation above does not output the same as
     $ git show --abbrev-commit --pretty=oneline --decorate --all --quiet
     since "git show" keeps the alphabetic order that "--all" returns the
     refs in, even if the option "--date-order" was passed.)
    For good measure, this also adds the "--do-walk" option which overrides
    "--no-walk".
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 37 in “cherry-pick and 'log --no-walk' and ordering”
  1. Martin von ZweigbergkAug 10, 2012
  2. Junio C HamanoAug 10, 2012
  3. Martin von ZweigbergkAug 11, 2012
  4. Junio C HamanoAug 11, 2012
  5. 0/4 Re: cherry-pick and 'log --no-walk' and orderingy@google.com, Aug 13, 2012
  6. Junio C HamanoAug 13, 2012
  7. Junio C HamanoAug 13, 2012
  8. Martin von ZweigbergkAug 13, 2012
  9. Junio C HamanoAug 13, 2012
  10. Martin von ZweigbergkAug 13, 2012
  11. Junio C HamanoAug 13, 2012
  12. Martin von ZweigbergkAug 13, 2012
  13. 0/3 revision (no-)walking in orderMartin von Zweigbergk, Aug 29, 2012
  14. 1/3 teach log --no-walk=unsorted, which avoids sortingMartin von Zweigbergk, Aug 29, 2012
  15. Dan JohnsonAug 29, 2012
  16. Junio C HamanoAug 29, 2012
  17. 2/3 demonstrate broken 'git cherry-pick three one two'Martin von Zweigbergk, Aug 29, 2012
  18. Junio C HamanoAug 30, 2012
  19. 3/3 cherry-pick/revert: respect order of revisions to pickMartin von Zweigbergk, Aug 29, 2012
  20. Junio C HamanoAug 29, 2012
  21. Martin von Zweigbergk has a new e-mail addressMartin von Zweigbergk, Aug 29, 2012
  22. 1/4 teach log --no-walk=unsorted, which avoids sortingy@google.com, Aug 13, 2012
  23. 2/4 revisions passed to cherry-pick should be in "default" ordery@google.com, Aug 13, 2012
  24. Junio C HamanoAug 13, 2012
  25. Martin von ZweigbergkAug 13, 2012
  26. Junio C HamanoAug 13, 2012
  27. Martin von ZweigbergkAug 15, 2012
  28. Junio C HamanoAug 15, 2012
  29. Martin von ZweigbergkAug 15, 2012
  30. Junio C HamanoAug 15, 2012
  31. Martin von ZweigbergkAug 15, 2012
  32. Martin von ZweigbergkAug 13, 2012
  33. Junio C HamanoAug 13, 2012
  34. 3/4 cherry-pick/revert: respect order of revisions to picky@google.com, Aug 13, 2012
  35. 4/4 cherry-pick/revert: default to topological sortingy@google.com, Aug 13, 2012
  36. Junio C HamanoAug 13, 2012
  37. Junio C HamanoAug 13, 2012

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.