aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/log.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-19 10:58:31 -0800
committerJunio C Hamano <gitster@pobox.com>2024-12-19 10:58:31 -0800
commitcb89eebf3bb0b78c5193f8b6293b4b22ce8b08ca (patch)
treee40d34e3a7718102cd77b845067acbb76812ad62 /builtin/log.c
parentMerge branch 'bf/fetch-set-head-config' (diff)
parentlog: --remerge-diff needs to keep around commit parents (diff)
downloadgit-cb89eebf3bb0b78c5193f8b6293b4b22ce8b08ca.tar.gz
git-cb89eebf3bb0b78c5193f8b6293b4b22ce8b08ca.zip
Merge branch 'js/log-remerge-keep-ancestry'
"git log -p --remerge-diff --reverse" was completely broken. * js/log-remerge-keep-ancestry: log: --remerge-diff needs to keep around commit parents
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 368f6580a6..923e4e6069 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -528,10 +528,14 @@ static int cmd_log_walk_no_free(struct rev_info *rev)
* but we didn't actually show the commit.
*/
rev->max_count++;
- if (!rev->reflog_info) {
+ if (!rev->reflog_info && !rev->remerge_diff) {
/*
* We may show a given commit multiple times when
- * walking the reflogs.
+ * walking the reflogs. Therefore we still need it.
+ *
+ * Likewise, we potentially still need the parents
+ * of * already shown commits to determine merge
+ * bases when showing remerge diffs.
*/
free_commit_buffer(the_repository->parsed_objects,
commit);