Re: [PATCH] Avoid errors from git-rev-parse in gitweb blame

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jakub Narebski
Date: Wednesday, June 4, 2008 - 5:31 am

Lea Wiemann wrote:

Or at least (in the first implementation) to avoid caching them in
memory-based cache (and serve them uncached).

Although I wonder how memory-based caches such as memcached or swifty,
and perhaps also mmap based cache (BerkeleyDB based cache is supposedly
fast because it fits into memory/caches in memory) deals with overly
large cache entries...


With modified (enhanced) git-blame output code would look like this
(rough pseudocode):

  while (<$fd>) {
    ...
    <parse 'parent' header>
    ...
  }

while using no-walk rev-list requires list of blamed parents upfront,
so the code would have to look like this

  @blame_data = <$fd>;
  @commitlist = map { <get sha1> } grep { <header line> } @blame_list;
  %commit_parents = get_parents(\@commitlist); # calls git-rev-list
  foreach (@commitlist) {
    ...
    ...
  }

Note that you read whole data into gitweb, inclreasing memory usage...
which we want to avoid, especially when using memcached or similar
caching backend (git-blame itself has to keep data in memory, but no
need to duplicate the amount).


Besides git-blame output needs to be extended/enhanced anyway for the
data mining / annotated file history navigation Luben wanted to be
really robust.  See my response to Linus email in this thread (to be
written).


I have in my git repository original version (well, one of original
versions) adding incremental blame output

  Message-ID: <20070825222404.16967.9402.stgit@rover>
  http://permalink.gmane.org/gmane.comp.version-control.git/56657

by Petr Baudis, tweaked version of Fredrik Kuivinen patch, and in the
commit message there is the floowing info:

    Compared to the original patch, this one works with pathinfo-ish URLs as
    well, and should play well with non-javascript browsers as well (the HTML
    points to the blame action, while javascript code rewrites the links to use
    the blame_incremental action; it is somewhat hackish but I couldn't think
    of a better solution).

Instead of rewriting links gitweb's JavaScript could use JavaScript
redirect trickery, using JavaScript (by setting location.href for
example) to redirect to blame_incremental action from blame action.


As to checking if browser is AJAX capable: you can at least check
if all methods needed are available.


P.S. You would probably want to remove old git-annotate based git_blame
(dead code, currently not used by any action), and rename git_blame2 to
git_blame.  A bit less code to check for caching problems etc,...
-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Avoid errors from git-rev-parse in gitweb blame, Rafael Garcia-Suarez, (Tue Jun 3, 3:46 am)
Re: [PATCH] Avoid errors from git-rev-parse in gitweb blame, Rafael Garcia-Suarez, (Tue Jun 3, 5:03 am)
Re: [PATCH] Avoid errors from git-rev-parse in gitweb blame, Rafael Garcia-Suarez, (Tue Jun 3, 6:00 am)
Re: [PATCH] Avoid errors from git-rev-parse in gitweb blame, Rafael Garcia-Suarez, (Tue Jun 3, 6:36 am)
Re: [PATCH] Avoid errors from git-rev-parse in gitweb blame, Rafael Garcia-Suarez, (Tue Jun 3, 7:40 am)
Re: [PATCH] Avoid errors from git-rev-parse in gitweb blame, Rafael Garcia-Suarez, (Tue Jun 3, 8:07 am)
Re: [PATCH] Avoid errors from git-rev-parse in gitweb blame, Jakub Narebski, (Wed Jun 4, 5:31 am)