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

Re: bugreport: git apply -3 confusing "lacks the necessary blob"

From
JKJan Kratochvil <jan@jankratochvil.net>
Date
Aug 20, 2021, 09:26 UTC
Message-ID
<YR91RNbfPwrTZ/3c@host1.jankratochvil.net>
In-Reply-To
<73a31988-d298-0168-43d5-849f91366d7d@gmail.com>
On Fri, 20 Aug 2021 11:19:39 +0200, Bagas Sanjaya wrote:
Show 11 quoted lines
> On 19/08/21 01.17, Jan Kratochvil wrote:
> > reproducer:
> > (set -ex;: rm -rf gitgit;mkdir gitgit;cd gitgit;git init;echo a >x;git add x;git commit -am.;git checkout -b b;echo b >x;git commit -am.;git checkout master;echo c >x;git commit -am.;git diff master^..b|grep -v ^index >b.diff;git apply -3 b.diff || cat b.diff)
> 
> I can reproduce your issue on latest Git (2.33.0).
> 
> It seems like you remove `index` line, which **may** contain blob hash
> information required for three-way merge with git apply -3.
> 
> But if you don't remove it when generating patch that way, you will get
> expected conflict when git applying.
Yes.

The problem is when the 'index' line is already removed (as it was always being removed in my existing setup) it is difficult to find out that is the reason of this confusing message. So the error message should be different when the 'index' line is missing at all.

Jan
Previous: Bagas SanjayaNext: Junio C Hamano
Message 3 of 7 in “bugreport: git apply -3 confusing "lacks the necessary blob"”
  1. Jan KratochvilAug 18, 2021
  2. Bagas SanjayaAug 20, 2021
  3. Jan KratochvilAug 20, 2021
  4. Junio C HamanoAug 20, 2021
  5. Jan KratochvilAug 20, 2021
  6. Jan KratochvilAug 27, 2021
  7. Junio C HamanoAug 27, 2021

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.