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

Re: git update --prune issue

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Oct 27, 2009, 23:30 UTC
Message-ID
<20091027233056.GA25689@atjola.homenet>
In-Reply-To
<20091027184627.GA19292@sigill.intra.peff.net>
On 2009.10.27 14:46:27 -0400, Jeff King wrote:
Show 9 quoted lines
> On Tue, Oct 27, 2009 at 12:50:55PM -0400, Jeff King wrote:
> 
> > > Actually, it's beta_gc_dev_old and beta_gc_dev, not the same refs.
> > 
> > OK, I'm a bit blind. Thanks for pointing it out. I'll still see if I can
> > replicate it.
> 
> I'm not having any luck reproducing here with a simple case. :( I'm
> trying:

You need more parent repos, and you need packs. What I guess what happens is:

The first remote gets fetched from. The first remote gets pruned. This initializes the pack stuff. The second remote gets fetched from, and creates a _new_ _pack_. The second remote gets pruned (*) The third remote gets fetched from. The third remote gets pruned.

Now, this prune step calls for_each_ref, which looks through the new refs for the second remote. This fails, because the new pack was not present when the pack "system" got initialzed.

(*) I have no idea why this step doesn't fail... But hey, I have no idea about the whole pack handling either. I just recall that there's some initialization step...

This reproduces the issue here:
#!/bin/sh
rm -rf parent* child
commit() {
  echo $1 >file && git add file && git commit -m $1
}
mkdir parent0 && (
  cd parent0 &&
  git init &&
  commit one
) &&
mkdir parent1 && (
  cd parent1 &&
  git init &&
  commit two &&
  commit three &&
  git checkout -b other
) &&
mkdir parent2 && (
  cd parent2 &&
  git init &&
  commit four
) &&
mkdir child && (
  cd child &&
  git init &&
  git config fetch.unpackLimit 1
  git remote add parent0 file://$PWD/../parent0 &&
  git remote add parent1 file://$PWD/../parent1 &&
  git remote add parent2 file://$PWD/../parent2 &&
  git remote update
) && (
  cd parent1 &&
  git checkout master &&
  git branch -d other &&
  git reset --hard HEAD^ &&
  commit five
) && (
  cd child &&
  git remote update --prune
)
Previous: Jeff King
Message 9 of 9 in “git update --prune issue”
  1. Jeffrey MiddletonOct 26, 2009
  2. Michael J GruberOct 27, 2009
  3. Jeffrey MiddletonOct 27, 2009
  4. Jeff KingOct 27, 2009
  5. Jeffrey MiddletonOct 27, 2009
  6. Clemens BuchacherOct 27, 2009
  7. Jeff KingOct 27, 2009
  8. Jeff KingOct 27, 2009
  9. Björn SteinbrinkOct 27, 2009

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.