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

Re: RFC: Should git gc/repack respect .git/refs/replace?

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Jul 23, 2011, 09:20 UTC
Message-ID
<m2wrf9cq0i.fsf@igel.home>
In-Reply-To
<CAH3AnrqDbebODK-A90msoB9JXUwDHKKtQAQo5VdXZ=k8bxzkYQ@mail.gmail.com>
Jon Seymour <jon.seymour@gmail.com> writes:
Show 10 quoted lines
> I recently damaged a USB drive containing an archive of a finished project.
>
> I am able to paper over a week of missing history by using the git
> replace mechanism, so that git rev-list now works as expected.
>
> When I run git gc or git repack, I get the following:
>
>    error: Could not read 023a1d5d3977420ba041cb556c0eee17c326aeb6
>    fatal: Failed to traverse parents of commit
> 44d578ea81f7a90989e2ee3c676f50e3aff7071f
git-replace(1):
       Replacement references will be used by default by all git commands
       except those doing reachability traversal (prune, pack transfer and
       fsck).

This is required, since the replaced objects are not supposed to be recycled. If you want to make the replacements permanent use git filter-branch.

Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Jon SeymourNext: Jon Seymour
Message 2 of 4 in “RFC: Should git gc/repack respect .git/refs/replace?”
  1. Jon SeymourJul 23, 2011
  2. Andreas SchwabJul 23, 2011
  3. Jon SeymourJul 23, 2011
  4. Jakub NarebskiJul 23, 2011

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.