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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]