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

Re: git pull failure, truncated object

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 8, 2007, 15:05 UTC
Message-ID
<20070508150536.GR11311@spearce.org>
In-Reply-To
<20070508145916.GQ11311@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> wrote:
Show 6 quoted lines
> Don't run git-gc on a repository that is acting strangely, unless
> you have concluded that the correct course of action is to just
> repack the repository.  (It rarely is, btw.)  You could make things
> worse if a packfile contains a corrupt object and you have the
> same valid loose object; a gc would delete the valid object and
> keep the corrupt one.

OK, my statement is a little blown-out-of-proportion. Its pretty hard these days to corrupt an object within a packfile such that we'll be able to reuse it during the repack that goes on in git-gc, but still actually have it be corrupt enough that the object is useless. The recent index version 2 work from Nico makes it even harder, as the index adds an additional checksum over the entire object header and body.

But still, even though the risk is pretty small, I think that running a destructive operation like git-gc in a repository that is not acting normally is a bad idea. You should try to diagnose and correct the issue before making further changes (or reorganizations) to that repository's contents.

-- 
Shawn.
Previous: Shawn O. PearceNext: Nicolas Pitre
Message 3 of 6 in “git pull failure, truncated object”
  1. Bill LearMay 8, 2007
  2. Shawn O. PearceMay 8, 2007
  3. Shawn O. PearceMay 8, 2007
  4. Nicolas PitreMay 8, 2007
  5. Bill LearMay 8, 2007
  6. Nicolas PitreMay 8, 2007

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.