Thread (44 messages) flat view 44 messages, 12 authors, 2016-06-15

Re: More precise tag following

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:42:51

Simon 'corecode' Schubert wrote:
Johannes Schindelin wrote:
quoted
It is slower than Subversion's counterpart, just because SVN's blame 
sucks. You cannot find out the _relevant_ information easily, i.e. once 
you merged something, the _merge_ gets attributed for the change (at
least the last time I tried it).

So, don't blame blame for being useful in git.
Your reasoning is backwards.  Git's blame (or fwiw, rev-list path.name)
is not slower because it is doing a better job (I can't tell, I don't
use svn), but because it uses an algorithm which doesn't scale.
rev-list and blame are O(number of commits between HEAD and root) and not
O(number of commits affecting path).  It might be sufficient for git.git,
but certainly not for projects with a long history.  we are talking KDE,
FreeBSD, OOo, something like this.  They each got about 400k commits.
It takes literally *minutes* to get a rev-list or a blame for a certain
path.  The algorithm simply does not scale.  And this has nothing to do
with superior output, because hg does it in O(num_of_file_revs), so it
*can* be done.          
Mercurial (hg) has different repository structure, with changesets in
per filename "buckets", tied together with mainfest file and changelog
file. So it is easy to get per file history in hg, while it is harder
to get per commit (general) history; contrary to git where it is easy
to get per commit (general) history, and it is harder to get per file
history.

On the other hand IIRC Mercurial, due to its repository structure, has some
problems with file copying and renames, not to mention more complicated 
contents movement (of which git-blame is aware of). Perhaps this structure
is/was also the cause that Mercurial is geared towards one branch per
repository workflow.
 
quoted
Of course, you could introduce a cache, but then, I don't run blame
_that_ often.
I don't think a cache is the right way.  I'd call the right idea
"auxillary information". 
If the information can be regenerated, this is cache. (Well, this is
one point of view).

P.S. In git we can use so called pickaxe (options to git-diff/git-log)
besides using annotate/blame.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help