# [PATCH] git-log --reflog -p --full-history: Show commit diffs instead of faked diffs

1 messages from 2007-03-23 to 2007-03-23. Participants: Johannes Schindelin.
Thread: https://gitlist.dev/t/7371

## Johannes Schindelin, 2007-03-23 20:21

Subject: [PATCH] git-log --reflog -p --full-history: Show commit diffs instead of faked diffs
Message-ID: <Pine.LNX.4.63.0703232120560.4045@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0703232120560.4045%40wbgn013.biozentrum.uni-wuerzburg.de

```

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 <johannes.schindelin@gmx.de>
---
 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

```
