[PATCH] git-log --reflog -p --full-history: Show commit diffs instead of faked diffs
From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:01
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:01
Subsystem:
the rest · Maintainer:
Linus Torvalds
With `--reflog` and `-p`, git-log will show diffs according to the reflog
history, while adding `--full-history` will produce the true commit diffs.
In other words, `git-log -g -p HEAD` will show the diff between HEAD@{n+1}
and HEAD@{n} with each commit HEAD@{n}.
In contrast, `git-log -g -p --full-history HEAD`, will show the diff
between HEAD@{n}^ and HEAD@{n} with each commit HEAD@{n}.
Signed-off-by: Johannes Schindelin <redacted>
---
revision.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/revision.c b/revision.c
index f23c1d5..edd7dfd 100644
--- a/revision.c
+++ b/revision.c@@ -1197,6 +1197,7 @@ static struct commit *get_revision_1(struct rev_info *revs) do { struct commit_list *entry = revs->commits; struct commit *commit = entry->item; + struct commit_list *parents = commit->parents; revs->commits = entry->next; free(entry);
@@ -1215,6 +1216,8 @@ static struct commit *get_revision_1(struct rev_info *revs) continue; add_parents_to_list(revs, commit, &revs->commits); } + if (revs->reflog_info && !revs->simplify_history) + commit->parents = parents; if (commit->object.flags & SHOWN) continue;
--
1.5.1.rc1.2356.g2054