git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jan Kratochvil <jan@jankratochvil.net>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: bugreport: git apply -3 confusing "lacks the necessary blob"
Date: Fri, 20 Aug 2021 11:26:28 +0200	[thread overview]
Message-ID: <YR91RNbfPwrTZ/3c@host1.jankratochvil.net> (raw)
In-Reply-To: <73a31988-d298-0168-43d5-849f91366d7d@gmail.com>

On Fri, 20 Aug 2021 11:19:39 +0200, Bagas Sanjaya wrote:
> 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

  reply	other threads:[~2021-08-20  9:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 18:17 bugreport: git apply -3 confusing "lacks the necessary blob" Jan Kratochvil
2021-08-20  9:19 ` Bagas Sanjaya
2021-08-20  9:26   ` Jan Kratochvil [this message]
2021-08-20 17:40   ` Junio C Hamano
2021-08-20 18:30     ` Jan Kratochvil
2021-08-27 15:15     ` Jan Kratochvil
2021-08-27 17:14       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YR91RNbfPwrTZ/3c@host1.jankratochvil.net \
    --to=jan@jankratochvil.net \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).