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

Re: bug: git fetch reports too many unreachable loose objects

From
Elijah Newren <newren@gmail.com>
Date
Dec 8, 2018, 02:23 UTC
Message-ID
<CABPp-BE_fvO-pcAT6hYNK2+M0Bt63XhyvZFF3wrrcNp4MsjtYg@mail.gmail.com>
In-Reply-To
<CAKQQkGppdO5pwOpG+sJ0uc2uPW867TZzWzc0ZntPd6MkqsozFQ@mail.gmail.com>
On Fri, Dec 7, 2018 at 6:14 PM Josh Wolfe <josh@okcupid.com> wrote:
Show 40 quoted lines
>
> git version 2.19.1
> steps to reproduce:
>
> # start in a brand new repo
> git init
>
> # create lots of unreachable loose objects
> for i in {1..10000}; do git commit-tree -m "$(head -c 12 /dev/urandom
> | base64)" "$(git mktree <&-)" <&-; done
> # this prints a lot of output and takes a minute or so to run
>
> # trigger git gc to run in the background
> git fetch
> # Auto packing the repository in background for optimum performance.
> # See "git help gc" for manual housekeeping.
>
> # trigger it again
> git fetch
> # Auto packing the repository in background for optimum performance.
> # See "git help gc" for manual housekeeping.
> # error: The last gc run reported the following. Please correct the root cause
> # and remove .git/gc.log.
> # Automatic cleanup will not be performed until the file is removed.
> #
> # warning: There are too many unreachable loose objects; run 'git
> prune' to remove them.
>
> # to manually fix this, run git prune:
> git prune
>
> # note that `git gc` does not fix the problem, and appears to do
> nothing in this situation:
> git gc
>
>
> According to the `git fetch` output, the `git help gc` docs, and the
> `git help prune` docs, I don't think I shouldn't ever have to run `git
> prune` manually, so this behavior seems like a bug to me. Please
> correct me if this is expected behavior.
Known bug, there are a variety of other ways to trigger it too.  See
the threads here for more info:
  https://public-inbox.org/git/87inc89j38.fsf@evledraar.gmail.com/
  https://public-inbox.org/git/20180716172717.237373-1-jonathantanmy@google.com/
There are probably other threads as well.
Previous: Josh Wolfe
Message 2 of 2 in “bug: git fetch reports too many unreachable loose objects”
  1. Josh WolfeDec 8, 2018
  2. Elijah NewrenDec 8, 2018

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.