"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: faster history traversal for 'got blame'
To:
Martin Pieuchot <mpi@openbsd.org>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 8 Jan 2020 09:26:50 +0100

Download raw body.

Thread
On Wed, Jan 08, 2020 at 08:33:06AM +0100, Martin Pieuchot wrote:
> One question below:
> 
> > @@ -129,6 +129,7 @@
> >  #define GOT_ERR_REF_NAME_MINUS	113
> >  #define GOT_ERR_GITCONFIG_SYNTAX 114
> >  #define GOT_ERR_REBASE_OUT_OF_DATE 115
> > +#define GOT_ERR_CACHE_DUP_ENTRY	116
> >  
> >  static const struct got_error {
> >  	int code;
> > @@ -265,6 +266,7 @@ static const struct got_error {
> >  	{ GOT_ERR_GITCONFIG_SYNTAX, "gitconfig syntax error" },
> >  	{ GOT_ERR_REBASE_OUT_OF_DATE, "work tree must be updated before it "
> >  	    "can be used to rebase a branch" },
> > +	{ GOT_ERR_CACHE_DUP_ENTRY, "duplicate cache entry" },
> 
> Isn't a duplicated cache entry some kind of code error?  Or this can
> happen in a repo?

Just to catch coding errors.
I don't want to rely on asserts or other hard failures in this code.

Reading objects via privsep can be expensive.
These caches avoid repeated decompression and copying of the same data.
The repo format itself has no idea of caching.

To see the impact of caching, try a build with
CFLAGS += -DGOT_NO_OBJ_CACHE