Subject: Re: [EGIT PATCH 3/3] Add a ref log reader class

From: "Shawn O. Pearce" <[email-masked]>
Date: Sun, 7 Jun 2009 15:47:54 -0700

Robin Rosenberg <[email-masked]> wrote:
> m?ndag 08 juni 2009 00:21:54 skrev "Shawn O. Pearce" <[email-masked]>:
> > Robin Rosenberg <[email-masked]> wrote:
> ...
> > > +			int p1 = RawParseUtils.next(raw, p0 + 1, ':');
> > > +			if (p1 == -1)
> > > +				throw new IllegalArgumentException(
> > > +						"Raw log message does not parse as log entry");
> > 
> > Technically, missing a ':' is legal.  Everything after the '\t'
> > is the comment.  It may be splittable into an action/comment,
> > it might not be.
> 
> Do you think I should just skip parsing out action? I don't really need it. I can
> go with everything after tab as one string for my purposes, i.e. reading reflogs
> in JUnit tests.

Yea, just skip it.
 
> As for optimized reading, I'd rather spend my time on something else. Reading
> reflogs won't likely be a real problem and I think the interface will be stable
> even if it needs to be optimized.
> 
> The other stuff I'll fix.

OK, sounds fine to me.

Maybe we should cap the limit at say 20 MiB of log or something, and
refuse to read anything more than that, rather than allowing 2 GiB.

Or, since we most likely only care about the tail, if its over 5
MiB, skip through to the end and then read the last 5 MiB, and if we
have a partial entry left over at the start of the buffer, ignore it.

-- 
Shawn.