Re: [PATCH v2 1/3] teach log --no-walk=unsorted, which avoids sorting

2012-08-29 Thread Junio C Hamano
Dan Johnson  writes:

> Perhaps I am missing something from an earlier discussion, but it is

  http://thread.gmane.org/gmane.comp.version-control.git/203259/focus=203344

> not obvious to me why this is an option to the no-walk behavior and
> not something like --sorted/--unsorted as a separate option.
>
> In other words, I don't understand why you always want to sort if you
> are doing revision walking.

When you have more than one starting points to dig the history from
(e.g. "git log foo bar baz"), you would want to start digging from
the newer ones, as that would help you find the fork points of the
branches involved more efficiently.  But you need to follow the
previous discussion if you want to understand implications around
sorting.

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


Re: [PATCH v2 1/3] teach log --no-walk=unsorted, which avoids sorting

2012-08-29 Thread Dan Johnson
On Wed, Aug 29, 2012 at 2:15 AM, Martin von Zweigbergk
 wrote:
> When 'git log' is passed the --no-walk option, no revision walk takes
> place, naturally. Perhaps somewhat surprisingly, however, the provided
> revisions still get sorted by commit date. So e.g 'git log --no-walk
> HEAD HEAD~1' and 'git log --no-walk HEAD~1 HEAD' give the same result
> (unless the two revisions share the commit date, in which case they
> will retain the order given on the command line). As the commit that
> introduced --no-walk (8e64006 (Teach revision machinery about
> --no-walk, 2007-07-24)) points out, the sorting is intentional, to
> allow things like
>
>  git log --abbrev-commit --pretty=oneline --decorate --all --no-walk
>
> to show all refs in order by commit date.
>
> But there are also other cases where the sorting is not wanted, such
> as
>
>   |
>git log --oneline --no-walk --stdin
>
> To accomodate both cases, leave the decision of whether or not to sort
> up to the caller, by allowing --no-walk={sorted,unsorted}, defaulting
> to 'sorted' for backward-compatibility reasons.
>
> Signed-off-by: Martin von Zweigbergk 
> ---

Perhaps I am missing something from an earlier discussion, but it is
not obvious to me why this is an option to the no-walk behavior and
not something like --sorted/--unsorted as a separate option.

In other words, I don't understand why you always want to sort if you
are doing revision walking.

Thanks for any explanation,
-Dan
--
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