git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] Introduce git-hive

From
CDCasey Dahlin <cdahlin@redhat.com>
Date
Aug 31, 2010, 14:38 UTC
Message-ID
<20100831143839.GC16034@foucault.redhat.com>
In-Reply-To
<AANLkTinx_Y1iUt9tj4io=GskwRyvK2EdWv9cO9gAbxBS@mail.gmail.com>
On Tue, Aug 31, 2010 at 11:29:02AM +1000, Nguyen Thai Ngoc Duy wrote:
Show 22 quoted lines
> On Tue, Aug 31, 2010 at 7:17 AM, Luke Kenneth Casson Leighton
> <luke.leighton@gmail.com> wrote:
> > On Mon, Aug 30, 2010 at 8:59 PM,  <cdahlin@redhat.com> wrote:
> >> From: Casey Dahlin <cdahlin@redhat.com>
> >>
> >> This isn't really what I'd normally call ready for public consumption, but
> >> since there's been some minimal list chatter on a similar subject I figured I'd
> >> put this out there early.
> >>
> >> git-hive is a peer to peer service for exchanging branches. When started it
> >> runs a small daemon to publish your repository on a random (or specified) port.
> >> Two hive daemons connected to oneanother can exchange branch lists and
> >> introduce eachother to more hive daemons to widen the network.
> >
> >  p.s. is there any location where, in diagrammatic form, the
> > protocol's described?
> 
> Also a short tutorial how to use it would be nice.
> 
> I take it I can put different repositories (say wine.git and git.git)
> in the hive. When I fetch git.git from the hive, it won't fetch
> wine.git?

First step to using hive is to set the project uri for your repo (may change this to a different mechanism later).

	casey@host_a$ git config --add hive.uri http://myproject.org

This is what prevents the scenario you describe; repos with the same project URI are assumed to be compatible. It can be given as a command line argument to 'git hive start', but this way is much more usable.

Next we start the service for our repo.
	casey@host_a$ git hive start --listen-port 21121

Normally the listen port is selected randomly. We specify it here so that other hive users can explicitly connect to us and "bootstrap" themselves into the hive network.

Now to have someone join.
	nguyen@host_b$ git config --add hive.uri http://myproject.org
	nguyen@host_b$ git hive start host_a.com:21121

So from host_b we specify host_a's address and listen port, and we join the network. From here on out anyone who also connects to host_a will get host_b's (randomly selected) listen port automatically and be able to connect to it as well.

So now our two peers can see each other.
	casey@host_a$ git hive show --branches
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>
		master
		for_casey
	
	---
	nguyen@host_b$ git hive show --branches
	Casey Dahlin <cdahlin@redhat.com>
		master
		stable
		v2.1
And we can exchange them
	casey@host_a$ git hive fetch nguyen for_casey
	casey@host_a$ git branch
	* master
	  stable
	  for_casey

Note that the two arguments in fetch are a regex which searches through user IDs and a branch name, which is why I can abbreviate to just "nguyen" in all lower case.

--CJD
Previous: Nguyen Thai Ngoc DuyNext: Luke Kenneth Casson Leighton
Message 4 of 18 in “Introduce git-hive”
  1. Introduce git-hivecdahlin@redhat.com, Aug 30, 2010
  2. Luke Kenneth Casson LeightonAug 30, 2010
  3. Nguyen Thai Ngoc DuyAug 31, 2010
  4. Casey DahlinAug 31, 2010
  5. Luke Kenneth Casson LeightonAug 31, 2010
  6. Casey DahlinAug 31, 2010
  7. Luke Kenneth Casson LeightonAug 31, 2010
  8. Casey DahlinAug 31, 2010
  9. Kevin BallardAug 31, 2010
  10. Ilari LiusvaaraSep 1, 2010
  11. Casey DahlinSep 1, 2010
  12. Giuseppe BilottaSep 5, 2010
  13. Casey DahlinAug 31, 2010
  14. Kevin BallardAug 31, 2010
  15. Casey DahlinAug 31, 2010
  16. Tomas CarneckySep 5, 2010
  17. Casey DahlinSep 6, 2010
  18. Casey DahlinSep 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.