path: root/builtin/log.c
diff options
authorMartin von Zweigbergk <>2012-08-29 06:15:54 (GMT)
committerJunio C Hamano <>2012-08-30 19:26:50 (GMT)
commitca92e59e30b503ff8861b6cd4d431d38738a7ee8 (patch)
treed253aef4dc21bb77348d3deef3e7982e58454221 /builtin/log.c
parent0ce2e396ee9fb0fa07e8381b338e49859dbf03db (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/log.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 906dca4..9e21d1b 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -454,7 +454,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
init_revisions(&rev, prefix);
rev.diff = 1;
rev.always_show_header = 1;
- rev.no_walk = 1;
rev.diffopt.stat_width = -1; /* Scale to real terminal size */
memset(&opt, 0, sizeof(opt));