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

Re: Exec upload-pack on remote with what parameters to get direntries.

From
SBStef Bon <stefbon@gmail.com>
Date
Aug 31, 2021, 06:38 UTC
Message-ID
<CANXojczR1hMrzz7t0P6AkqL3kjdk+NzBKyCQnm-9cWFbULifow@mail.gmail.com>
In-Reply-To
<YS0tNoAa/0VQe1OW@coredump.intra.peff.net>
Hi,
thank you for the answer.

I understand that the core of git is to make people work together when writing code. To get a tree of the source files is not directly part of that, but pure informational. That is also the intent of my fuse fs: provide the user information about the source files.

Now I have a working ssh connection to the server, and open a channel for running the upload-pack on the server using the exec channel request:

https://datatracker.ietf.org/doc/html/rfc4254#section-6.5
So in my program I do not have to do something like:
ssh -x git@server "git-upload-pack 'simplegit-progit.git'"

It is only the sending of an exec message with the right command. Via the SSH_MSG_CHANNEL_DATA message the server will return the output. In my program I have to write a parser to get the tree/direntries.

Now you suggest the git clone --depth 1 --filter=blob:none --single-branch -b $branch command. How does that look when writing it in lowlevel git messages as described in

https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols

? I'm programming at this low level, so I have to write the messages to send to the server myself.

And you mention the api github has for a git tree object. But git2 has already the git_tree object?

Stef
My project  by the way is: https://github.com/stefbon/OSNS
Previous: Junio C HamanoNext: Jeff King
Message 9 of 12 in “Exec upload-pack on remote with what parameters to get direntries.”
  1. Stef BonAug 28, 2021
  2. Jeff KingAug 30, 2021
  3. Junio C HamanoAug 30, 2021
  4. Jeff KingAug 30, 2021
  5. Junio C HamanoAug 30, 2021
  6. Ævar Arnfjörð BjarmasonAug 31, 2021
  7. Bruno AlbuquerqueAug 31, 2021
  8. Junio C HamanoAug 31, 2021
  9. Stef BonAug 31, 2021
  10. Jeff KingAug 31, 2021
  11. Stef BonAug 31, 2021
  12. Ævar Arnfjörð BjarmasonAug 31, 2021

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.