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

git peer-to-peer project: info needed

From
LLLuke Kenneth Casson Leighton <luke.leighton@gmail.com>
Date
Aug 29, 2010, 21:56 UTC
Message-ID
<AANLkTi=xLJ4w1D4=p40f8nUQfLu5hpEfNORnjroffM1v@mail.gmail.com>
hi folks,

[please could you kindly cc on responses because i am subscribed with "no mail" set]

i need some guidance on what i should be doing, to add peer-to-peer networking to "git fetch". i can take care of the peer-to-peer networking side: the bit i'm unsure about is what sequence of events are required to happen. i'm presently looking at the use of walker_fetch in builtin-http-fetch.c which gives me some idea. however as i aim to implement this first in python not c, i need to be using git via command-line only.

perhaps... does anyone know of an implementation of "git fetch" in say... shell-script (or perhaps in python) or just absolutely any language _other_ than c?

i believe... i believe i may need the git rev-list and git pack-objects commands, would that be right? rev-list gives the list of commit revisions; pack-objects, if i can merely transfer the .pack file and .index file over the peer-to-peer network, the job's half done, am i right?

(the only missing step is to have a way to find the list of objects at the remote end - i know how to do that)

following that, i can do "git unpack-objects" on the .pack file(s)

and... i've just done a test on that (manually, by running git-pack-objects --thin --all --stdout and then git-unpack-objects) ... um.... :) i'm missing the "tag updating", aren't i? the objects are now in the .git repo but they're "hanging about", as can be seen with git fsck:

$ git fsck dangling commit af87b49b9fbcae28ae19b86ca04af5bd4a9f6778

so... my next step iis... ermm... update the head ref? err? :) i see that gitpython is simply writing [the above ref] into .git/ref/heads/master or whereever is specified (must begin with refs) which is kinda cheating but perfectly reasonable... err.. but wait... i'm into what "git-pull.sh" is doing at this point, aren't i?

soo... i kinda don't have to worry about that bit, am i right? as long as i get to complete the "git-unpack-objects" stage, the rest can be handled by git-pull.sh, am i right?

much obliged some answers so that i can get this done, as free software, and provide people with a peer-to-peer distributed version of git.

l.
Next: Jonathan Nieder
Message 1 of 8 in “git peer-to-peer project: info needed”
  1. Luke Kenneth Casson LeightonAug 29, 2010
  2. Jonathan NiederAug 29, 2010
  3. Luke Kenneth Casson LeightonAug 29, 2010
  4. Matthieu MoyAug 30, 2010
  5. Luke Kenneth Casson LeightonAug 30, 2010
  6. Casey DahlinAug 30, 2010
  7. Casey DahlinAug 30, 2010
  8. Luke Kenneth Casson LeightonAug 30, 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.