Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Grafts/replace design


----- Ursprungligt meddelande -----
> On Sat, Sep 29, 2012 at 7:35 AM, Robin Rosenberg
> <robin.rosenberg@xxxxxxxxxx> wrote:
> 
> > The next step is tricker.
> 
> > The Repository knows about grafts and replacements, so we can just
> > ask it, but then we actually share instances, for efficiency and
> > smoothness within the application. Since the Repositories are
> > shared
> > we cannot just flip a flag to turn off the replacement map.
> 
> Yes this is true. But the Repository doesn't actually care about
> grafts or replacements, only specific ObjectReader, RevWalk, or
> ObjectWalk instances. These are not thread safe and are created
> per-operation that needs them. The flag belongs at this level, and
> the
> flag should default to using the grafts and replacements.
> 
> > We can add parameter to most methods in Repository and pass it
> > around
> 
> No. This is a horrible API.
> 
> > The other option I see is to create a new Repository instance
> > working with the same git repository, but with a different opinion
> > on
> > what to replace.
> 
> This is also a horrible API, and one I rejected in the code review.

So what do you suggest? Even simple things like resolve and peeling
of refs sometimes need to be performed without graft/replacement in
the transport/gc methods. One could probably recode them to use lower
level API's.

Then we have the user-controlled options to disable the rewiring. For
the CLI one can have a global flag (shudder), but then these thing
will not work within a container like Eclipse.

-- robin



Back to the top