aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-23 14:33:43 -0700
committerJunio C Hamano <gitster@pobox.com>2017-08-23 14:33:44 -0700
commit0cb526e031bd28f33750ed7beef1d7556ef387ea (patch)
tree3e7c8f360a71a1b3fd6f7fdefcb6f537d5de0183 /builtin
parent72140a73198b2fdbf6fc83ff679d3f553ed5faed (diff)
parentde239446b69f3b453050af8091e07aa5433421cc (diff)
downloadgit-0cb526e031bd28f33750ed7beef1d7556ef387ea.tar.gz
git-0cb526e031bd28f33750ed7beef1d7556ef387ea.tar.xz
Merge branch 'jk/reflog-walk' into maint
Numerous bugs in walking of reflogs via "log -g" and friends have been fixed. * jk/reflog-walk: reflog-walk: apply --since/--until to reflog dates reflog-walk: stop using fake parents rev-list: check reflog_info before showing usage get_revision_1(): replace do-while with an early return log: do not free parents when walking reflog log: clarify comment about reflog cycles revision: disallow reflog walking with revs->limited t1414: document some reflog-walk oddities
Diffstat (limited to 'builtin')
-rw-r--r--builtin/log.c9
-rw-r--r--builtin/rev-list.c3
2 files changed, 8 insertions, 4 deletions
diff --git a/builtin/log.c b/builtin/log.c
index c6362cf92..5ffc380bd 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -372,11 +372,14 @@ static int cmd_log_walk(struct rev_info *rev)
*/
rev->max_count++;
if (!rev->reflog_info) {
- /* we allow cycles in reflog ancestry */
+ /*
+ * We may show a given commit multiple times when
+ * walking the reflogs.
+ */
free_commit_buffer(commit);
+ free_commit_list(commit->parents);
+ commit->parents = NULL;
}
- free_commit_list(commit->parents);
- commit->parents = NULL;
if (saved_nrl < rev->diffopt.needed_rename_limit)
saved_nrl = rev->diffopt.needed_rename_limit;
if (rev->diffopt.degraded_cc_to_c)
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index fee10d856..e8f504890 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -11,6 +11,7 @@
#include "graph.h"
#include "bisect.h"
#include "progress.h"
+#include "reflog-walk.h"
static const char rev_list_usage[] =
"git rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
@@ -349,7 +350,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
/* Only --header was specified */
revs.commit_format = CMIT_FMT_RAW;
- if ((!revs.commits &&
+ if ((!revs.commits && reflog_walk_empty(revs.reflog_info) &&
(!(revs.tag_objects || revs.tree_objects || revs.blob_objects) &&
!revs.pending.nr)) ||
revs.diff)