git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marco Costalba" <mcostalba@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: That improved git-gui blame viewer..
Date: Tue, 12 Jun 2007 13:27:19 +0200	[thread overview]
Message-ID: <e5bfff550706120427g7ad9d38bpc34d9ea284ace693@mail.gmail.com> (raw)
In-Reply-To: <7vbqflll55.fsf@assigned-by-dhcp.pobox.com>

On 6/12/07, Junio C Hamano <gitster@pobox.com> wrote:
>
> > Annotate algorithm of qgit is little different in that it starts from
> > the oldest revision that modified a file and goes to the latest. In
> > this way we can have the whole file history annotated in one pass and
> > very fast.
>
> I am not sure about two things in this description.
>
>  (1) Are you emulating CVS-like "a file has an identity, and we
>      follow its changes" model?  How does it handle file split,
>      merge, and code movement in general?
>

It uses 'git rev-list HEAD -- <path>' to get the list of revisions
that modified a path,
I really would like to keep it like that because it is the way 'git'
works, and I would feel uncomfortable in filtering out git results, it
seems quite fragile to me.

This means that file splits, merges, renames etc.. are handled as much
as they are handled in git. IOW *if* 'git rev-list HEAD -- <path>'
returns a list of revisions taking in account all of the above, so it
will, automatically, do qgit.

BTW _currentlly_ git-rev-list does not do that.


>  (2) It is unclear why going from old to new has the advantage
>      of being "one pass", implication of which is that the
>      opposite direction needs to be done as more than one pass.
>      Care to enlighten?
>

Going from oldest to newest has this advantage:

1 - start from a known good first (empty) annotation, i.e. the first
revision in history has an empty annotation (this is a choice to get
consistent results when dealing with git repository started after the
begining of the project, Linux tree started from 2.6.12 is an
example).

2 - Given a good annotation (ann1) at a given time in history you can
calculate the next annotation (ann2), the annotation corresponding to
the next (newer) revision in history that modified the file using just
the diff between the two. If you don't discards ann1 you end up having
both ann1 and ann2.

3 - So at the end of applying all the diff chain you get all the
annotations for all the file revisions, each annotation requires only
the previous one and the corresponding diff.

4 - You don't need to touch anymore an already calculated file, nor
applying the corresponding diff more then one time.

So the complexity of annotating *all* the files revisions grows only
linearly with the revision list size.

 Marco

  reply	other threads:[~2007-06-12 11:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-09 18:26 That improved git-gui blame viewer Linus Torvalds
2007-06-09 18:29 ` Junio C Hamano
2007-06-11  6:42 ` Shawn O. Pearce
2007-06-11 15:46   ` Linus Torvalds
2007-06-11 16:05     ` Junio C Hamano
2007-06-12  6:16       ` Marco Costalba
2007-06-12  6:52         ` Junio C Hamano
2007-06-12 11:27           ` Marco Costalba [this message]
2007-06-12 11:58             ` Marco Costalba
2007-06-12 13:53             ` Shawn O. Pearce
2007-06-12 19:14               ` Junio C Hamano
2007-06-13 11:11                 ` Marco Costalba
2007-06-13 12:44                   ` Marco Costalba
2007-06-13 12:45                     ` Johannes Schindelin
2007-06-13 14:08                       ` Marco Costalba
2007-06-13 14:58                         ` Johannes Schindelin
2007-06-13 16:18                           ` Marco Costalba
2007-06-13 16:40                             ` Johannes Schindelin
2007-06-13 16:27                           ` Josef Weidendorfer
2007-06-13 16:50                             ` Johannes Schindelin
2007-06-13 16:54                             ` Josef Weidendorfer
2007-06-13 17:05                               ` Johannes Schindelin
2007-06-13 18:17                                 ` Josef Weidendorfer
2007-06-13 18:34                                   ` Johannes Schindelin
2007-06-13 17:17                               ` Junio C Hamano
2007-06-14  5:17                               ` Shawn O. Pearce
2007-06-13 23:20                 ` Jakub Narebski
2007-06-14  6:24                   ` Marco Costalba
2007-06-13 11:03               ` Marco Costalba

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=e5bfff550706120427g7ad9d38bpc34d9ea284ace693@mail.gmail.com \
    --to=mcostalba@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    --cc=torvalds@linux-foundation.org \
    /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).