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 - : 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