From: Linus Torvalds <torvalds@osdl.org>
To: Marco Costalba <mcostalba@gmail.com>
Cc: junkio@cox.net, git@vger.kernel.org
Subject: Re: gitweb.cgi history not shown
Date: Sat, 10 Jun 2006 23:02:10 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0606102248360.5498@g5.osdl.org> (raw)
In-Reply-To: <e5bfff550606102231o756f6d11lc46fecdad29568c0@mail.gmail.com>
On Sun, 11 Jun 2006, Marco Costalba wrote:
>
> 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
next prev parent reply other threads:[~2006-06-11 6:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-11 5:31 gitweb.cgi history not shown Marco Costalba
2006-06-11 6:02 ` Linus Torvalds [this message]
2006-06-11 6:32 ` Marco Costalba
2006-06-11 16:19 ` Linus Torvalds
2006-06-11 16:40 ` Linus Torvalds
2006-06-11 16:54 ` Linus Torvalds
2006-06-11 16:59 ` Jakub Narebski
2006-06-11 17:57 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0606102248360.5498@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=mcostalba@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).