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

Re: should git download missing objects?

From
Shawn Pearce <spearce@spearce.org>
Date
Nov 13, 2006, 19:54 UTC
Message-ID
<20061113195414.GD17244@spearce.org>
In-Reply-To
<20061113194532.GA4547@steel.home>
Alex Riesen <fork0@t-online.de> wrote:
Show 21 quoted lines
> Junio C Hamano, Sun, Nov 12, 2006 20:41:23 +0100:
> > Since this is not everyday anyway, a far easier way would be to
> > clone-pack from the upstream into a new repository, take the
> > pack you downloaded from that new repository and mv it into your
> > corrupt repository.  You can run fsck-objects to see if you got
> > back everything you lost earlier.
> 
> I get into such a situation annoyingly often, by using
> "git clone -l -s from to" and doing some "cleanup" in the
> origin repository. For example, it happens that I remove a tag,
> or a branch, and do a repack or prune afterwards. The related
> repositories, which had "accidentally" referenced the pruned
> objects become "corrupt", as you put it.
> 
> At the moment, if I run into the situation, I copy packs/objects from
> all repos I have (objects/info/alternates are useful here too), run a
> fsck-objects/repack and hope nothing is lost. It works, as I almost
> always have "accidental" backups somewhere, but is kind of annoying to
> setup. A tool to do this job more effectively will be very handy (at
> least, it wont have to copy gigabytes of data over switched windows
> network. Not often, I hope. Not _so_ many gigabytes, possibly).

One of my coworkers recently lost a single loose tree object. We suspect his Windows virus scanner deleted the file. :-(

Copying the one bad object from another repository immediately fixed the breakage caused, but it was very annoying to not be able to run a "git fetch --missing-objects" or some such. Fortunately it was just the one object and it was also still loose in another repository. scp was handy. :-)

Previous: Alex RiesenNext: Petr Baudis
Message 4 of 10 in “should git download missing objects?”
  1. Anand KumriaNov 12, 2006
  2. Junio C HamanoNov 12, 2006
  3. Alex RiesenNov 13, 2006
  4. Shawn PearceNov 13, 2006
  5. Petr BaudisNov 13, 2006
  6. Shawn PearceNov 13, 2006
  7. Junio C HamanoNov 13, 2006
  8. Petr BaudisNov 14, 2006
  9. Junio C HamanoNov 13, 2006
  10. Alex RiesenNov 13, 2006

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.