git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 23, 2007, 20:21 UTC
Message-ID
<Pine.LNX.4.63.0703232120560.4045@wbgn013.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
Message 1 of 1 in “git-log --reflog -p --full-history: Show commit diffs instead of faked diffs”
  1. git-log --reflog -p --full-history: Show commit diffs instead of faked diffsJohannes Schindelin, Mar 23, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.