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

Re: gitweb.cgi history not shown

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 11, 2006, 06:02 UTC
Message-ID
<Pine.LNX.4.64.0606102248360.5498@g5.osdl.org>
In-Reply-To
<e5bfff550606102231o756f6d11lc46fecdad29568c0@mail.gmail.com>
On Sun, 11 Jun 2006, Marco Costalba wrote:
Show 7 quoted lines
>
> What I do wrong?
> 
> $ git-rev-list --all -- gitweb/gitweb.cgi
> 0a8f4f0020cb35095005852c0797f0b90e9ebb74
> $ git-rev-list --all -- gitweb.cgi
> $
[ no output ]

This is getting to be a FAQ, and I think we should add the "--no-prune-history" flag (or whatever I called it - I even sent out a patch for it) so that you can avoid it.

The thing that happens in
	git-rev-list --all -- gitweb.cgi

is that since your _current_ HEAD does not have that file at all, it starts going back in history, and at each merge it finds it will _simplify_ the history, and only look at that part of history that is identical _with_respect_to_the_name_you_gave_!

Now, in the main git history, that name has NEVER existed, so the simplified history for that particular name (as seen from the current branch) is simply empty. It's empty all the way back to the root. No commits at all add that name along the main history branch.

Now, that name obviously existed in the _side_ histories, but we don't show those, because they obviously didn't matter (as far as that particular name happened) within the particular history starting point you chose. See?

Now, look what happens if you instead of starting the history search from all the _current_ heads, you start it from a location that actually _had_ that file:

	git log 1130ef362fc8d9c3422c23f5d5 -- gitweb.cgi
and suddenly there the history is - in all its glory.

So what this boils down to is really: when you limit revision history by a set of filenames, GIT REALLY REWRITES AND SIMPLIFIES THE HISTORY AS PER _THAT_ PARTICULAR SET OF FILENAMES. In particular, it will generate the _simplest_ history that is consistent with the state of those filenames at the point you asked it to start.

If you want to get the non-simplified history (ie you object to the fact that we give the simplest history, you want _all_ the possible history for that particular filename, whether it was the same along one branch or not), you need to apply something like the appended..

(And you obviously need to add that "no_simplify_merge" flag to the revision data structure, and you need to add some command line flag to enable it. Alternatively, try to find the patch I sent out a couple of months ago, I'm pretty sure I called it "--no-simplify-merge" or "--no-prune-history" or something like that).

		Linus
---
diff --git a/revision.c b/revision.c
index 6a6952c..5640cef 100644
--- a/revision.c
+++ b/revision.c
@@ -303,7 +303,7 @@ static void try_to_simplify_commit(struc
 		parse_commit(p);
 		switch (rev_compare_tree(revs, p->tree, commit->tree)) {
 		case REV_TREE_SAME:
-			if (p->object.flags & UNINTERESTING) {
+			if (revs->no_simplify_merge || (p->object.flags & UNINTERESTING)) {
 				/* Even if a merge with an uninteresting
 				 * side branch brought the entire change
 				 * we are interested in, we do not want
Previous: Marco CostalbaNext: Marco Costalba
Message 2 of 8 in “gitweb.cgi history not shown”
  1. Marco CostalbaJun 11, 2006
  2. Linus TorvaldsJun 11, 2006
  3. Marco CostalbaJun 11, 2006
  4. Linus TorvaldsJun 11, 2006
  5. Linus TorvaldsJun 11, 2006
  6. Linus TorvaldsJun 11, 2006
  7. Jakub NarebskiJun 11, 2006
  8. Linus TorvaldsJun 11, 2006

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.