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

Re: Some issues when trying to set up a shallow git mirror server

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 8, 2016, 10:44 UTC
Message-ID
<CACsJy8CBj-oMTLrn8gVudhLPEixZfkwFv9BaN8LSNFvOHkqKkg@mail.gmail.com>
In-Reply-To
<20160108101903.GC3397@logi.codethink.co.uk>
On Fri, Jan 8, 2016 at 5:19 PM, Richard Maw <richard.maw@codethink.co.uk> wrote:
Show 21 quoted lines
> On Thu, Jan 07, 2016 at 10:00:07AM -0800, Junio C Hamano wrote:
>> Richard Maw <richard.maw@codethink.co.uk> writes:
>> > This is inconvenient for us,
>> > as we were explicitly using refspecs which didn't force the fetch,
>> > since we were using the "non fast-forward update" errors
>> > to detect whether upstream force pushed important refs
>> > which could be a sign of tampering.
>> >
>> > While the client doesn't have enough information
>> > the server has those commits.
>> > Would it make sense for the server to be able to tell the client
>> > "trust me, that commit is a descendant of the previous one"?
>>
>> It does not in our security model, as you do not blindly trust the
>> other side, whether you are a "client" or a "server".
>
> Fair enough.
> I didn't know whether Git passed responsibility for that to the transport layer.
>
> Would a mode for fetch to also include the commit chain without the trees fit
> the security model?

It sounds a lot like what I did with narrow clone [2] prototype. A narrow clone only contains enough objects for certain paths so there's a chance that we just don't have enough to do a proper merge. A server-side command was added [1] to retrieve enough objects for the task. If you fetch commit chain without all necessary trees and objects, your repo is "broken" from Git point of view and you'll need to do some extra work to make sure your repo is not actually broken.

[1] http://article.gmane.org/gmane.comp.version-control.git/154371 [2] http://thread.gmane.org/gmane.comp.version-control.git/154343

-- 
Duy
Previous: Richard MawNext: Richard Maw
Message 4 of 11 in “Some issues when trying to set up a shallow git mirror server”
  1. Richard MawJan 7, 2016
  2. Junio C HamanoJan 7, 2016
  3. Richard MawJan 8, 2016
  4. Duy NguyenJan 8, 2016
  5. Richard MawJan 8, 2016
  6. Junio C HamanoJan 8, 2016
  7. Richard MawJan 11, 2016
  8. Junio C HamanoJan 12, 2016
  9. Richard MawJan 13, 2016
  10. Junio C HamanoJan 13, 2016
  11. Richard MawJan 13, 2016

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.