teach log --no-walk=unsorted, which avoids sorting
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
<command producing revisions in order> |
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 <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
0ce2e396ee
commit
ca92e59e30
@ -41,6 +41,10 @@ struct rev_cmdline_info {
|
||||
} *rev;
|
||||
};
|
||||
|
||||
#define REVISION_WALK_WALK 0
|
||||
#define REVISION_WALK_NO_WALK_SORTED 1
|
||||
#define REVISION_WALK_NO_WALK_UNSORTED 2
|
||||
|
||||
struct rev_info {
|
||||
/* Starting list */
|
||||
struct commit_list *commits;
|
||||
@ -62,7 +66,7 @@ struct rev_info {
|
||||
/* Traversal flags */
|
||||
unsigned int dense:1,
|
||||
prune:1,
|
||||
no_walk:1,
|
||||
no_walk:2,
|
||||
show_all:1,
|
||||
remove_empty_trees:1,
|
||||
simplify_history:1,
|
||||
|
Reference in New Issue
Block a user