On Mon, Aug 13, 2012 at 12:17 AM, Junio C Hamano <gits...@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.


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

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.schinde...@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

    $ 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

    Signed-off-by: Johannes Schindelin <johannes.schinde...@gmx.de>
    Signed-off-by: Junio C Hamano <gits...@pobox.com>
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to