[PATCH 0/5] Some very preliminary remote git access patches

Dirk Hohndel dirk at hohndel.org
Mon Feb 9 08:16:10 PST 2015


On Sun, Feb 08, 2015 at 07:13:17PM -0800, Linus Torvalds wrote:
> 
> So this isn't actually where I wanted to be, but I had a few false starts 
> with this, and spent too much time trying to figure out the oddities of 
> libgit2 before I just took a different approach.

It's a shame that they kept having to explain how this "git" thing works
to you... :-)

> I originally wanted to create a local cache of a remote git repository - 
> multiple branches and all. But the remote tracking branch behavior of 
> libgit2 was too confusing, and I eventually realized that I also want to 
> have a branch actually checked out in that local repository, so I ended up 
> modifying the "local cache" model so that each *branch* has its own local 
> cache.

So if someone (like you and I) has multiple branches in one repository,
they can still make this work by simply having two different base
directories locally?

> I even tried to make it put things in a sane place by using the 
> QStandardPaths::standardLocations interface, but since I only run Linux, I 
> have no idea how well that works anywhere else. For me, it means that the 
> private caches end up being held in your home directory in
> 
>    ~/.local/share/Subsurface/Subsurface/git-caches/

Cool. I like it.

> but from a user perspective that should not be something anybody really 
> cares about.
> 
> The five patches make it possible to basically point to a remote git 
> repository using something simple like
> 
>     subsurface git://remotehost/repo[branch]
> 
> but sadly, I never got around to actually figuring out why libgit2 doesn't 
> use the SSH config file, and how the authentication is supposed to work. 

That's kind of a critical piece, though, as my assumption is that people
will want to have at least somewhat private repos...

> So in practice, it's not actually useful for any private git repositories 
> on the network, and I've been just faking it by using
> 
>     subsurface file:///home/torvalds/scuba-mirror[linus]
> 
> instead.

Umm. A local remote git server. Almost useful :-)

> So why even send it out? Because of the five patches, the four first ones 
> are just preliminary helper setup, and the fifth one is likely the base 
> for whatever future real work. I think I got the design right, I just 
> haven't fought libgit2 to do authentication or indeed any progress 
> information.

So I read through the patches. 1-4 are obvious and I see no reason not to
put them in master. We should go back through the code and use the new and
improved helpers everywhere. There are LOTS of places in Subsurface that
could benefit from them. Especially the magic printf that returns a buffer
of the correct size. Genius.

> Aside from the fact that there is no authentication or progress 
> information, there's also a few small things missing (like actually 
> updating the local branch after fetching the remote, and the same when 
> saving), but I hope to get around to those separately.
> 
> Any comments about the preparatory patches?

I think they are fine - but I haven't tested them, yet.
Since they were all signed off I assume you are OK with me putting them
into master once I've done some testing?

/D


More information about the subsurface mailing list