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

Re: corrupted repo and "git push --mirror"

From
ILIlari Liusvaara <ilari.liusvaara@elisanet.fi>
Date
Oct 18, 2010, 09:06 UTC
Message-ID
<20101018090633.GA30603@LK-Perkele-V2.elisa-laajakaista.fi>
In-Reply-To
<AANLkTikZEa4GeQHMXC2vBc8_+1208oEs7d-0KGXBw0p2@mail.gmail.com>
On Mon, Oct 18, 2010 at 09:38:03AM +0530, Sitaram Chamarty wrote:
Show 8 quoted lines
> This is probably a stupid question, but in the spirit of extreme
> paranoia *and* because it's kinda hard to "try it and see", I'm going
> to risk the ridicule :)
> 
> Gitolite has mirroring support now, basically using "git push
> --mirror".  The question I was asked, and I couldn't *confidently*
> answer, was: what happens if the source repo suffers some corruption
> for some reason?  Does the corruption propagate?

I think the sending behaves like normal repack. The packfile object CRCs must match (assuming they are available, i.e. v2 index!). Loose objects might be down to zlib adler checksum.

However, some errors in pack generation process could cause logically inconsistent pack to be sent. Against that, one would need to enable receive-side fsck on receive (this is how the infamous jgit push bug corrupted repositories).

Transport errors are caught by underlying MACs or packfile SHA-1.
> Secondary question: what happens if the receiving repo is corrupt?

The push might fail or it might not. And not even receive-side fsck necressary catches the corruption (one would need full fsck for that).

-Ilari
Previous: Sitaram Chamarty
Message 2 of 2 in “corrupted repo and "git push --mirror"”
  1. Sitaram ChamartyOct 18, 2010
  2. Ilari LiusvaaraOct 18, 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.