Subject: Re: [PATCH 2/3] add new Git::Repo API

From: Jakub Narebski <[email-masked]>
Date: Fri, 18 Jul 2008 19:05:05 +0200

Dnia piątek 18. lipca 2008 18:48, Petr Baudis napisał:
> On Tue, Jul 15, 2008 at 12:19:31AM +0200, Lea Wiemann wrote:

> > No, you should never pass in an invalid SHA1 in the first place.  The
> > above piece of documentation is just a warning that bugs will show up
> > delayed.  IOW, this is not the right place to have your error handling.
> > 
> > If you're getting a SHA1 through the user-interface, check its existence
> > with get_sha1 before passing it to the constructor.
> 
> But that's an expensive operation, you need extra Git exec for this,
> while all the Git commands can do the checks for you, if you give them
> the chance.
> 
> I was doing pretty much this thing in Cogito (initially out of
> necessity) and it made it ungodly slow for any kind of batch operations.

Lea probably would point out that thanks to '--batch-check' option
to git-cat-file, and "reuse => 1" option to ->get_bidi_pipe you would
need only one extra Git exec...  BUT it is one extra Git exec per
entire Perl script (one per request, for example, for gitweb).
And it wouldn't help batching Perl script commands.

-- 
Jakub Narebski
Poland