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

Re: Add --ignore-missing to git-pack-objects?

From
Cch <cr@onlinehome.de>
Date
Aug 20, 2017, 16:05 UTC
Message-ID
<6b2b5649-f8a0-bf1e-3688-8a649b4ee5ad@onlinehome.de>
In-Reply-To
<20170820101632.irj22dighcrrcvlv@sigill.intra.peff.net>
Hi Jeff.
Thanks a lot for your response.
Jeff King wrote:
> So if I understand correctly, you are only using these for the negative
> side of the traversal?
Yes.
Jeff King wrote:
Show 5 quoted lines
> rev-list should ignore missing objects in such a
> case even without --ignore-missing, and I think it may simply be a bug
> if pack-objects is not.
> 
> Do you have a simple reproduction recipe?
Here's a small bash script to illustrate the core issue:
----
add_file()
{
     echo "$1" > "$1"
     git add "$1"
     git commit -m "$1"
}

git init . git config core.logAllRefUpdates false

add_file "test-1" add_file "test-2"

git checkout -b feature

add_file "test-3" add_file "test-4"

git checkout master

add_file "test-5" add_file "test-6"

feature_tip=$(git rev-list -1 feature)

echo -e "\nDeleting branch 'feature' ($feature_tip)..." git branch -D feature git gc --prune=now

echo -e "\nCalling git-pack-objects with (now deleted) ^$feature_tip..." git pack-objects --all --revs --stdout --thin --delta-base-offset --all-progress-implied <<< ^$feature_tip > pack

echo -e "\nCalling git-rev-list with (now deleted) ^$feature_tip..." git rev-list --all ^$feature_tip

echo -e "\nCalling git-rev-list --ignore-missing with (now deleted) ^$feature_tip..." git rev-list --all --ignore-missing ^$feature_tip ----

Both, git-pack-objects and git-rev-list (without --ignore-missing) fail with
fatal: bad object <feature_tip>
on git version 2.14.1.windows.1.
Previous: Jeff King
Message 3 of 3 in “Add --ignore-missing to git-pack-objects?”
  1. chAug 14, 2017
  2. Jeff KingAug 20, 2017
  3. chAug 20, 2017

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.