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

Re: "git apply --check" successes but git am says "does not match index"

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 15, 2011, 23:52 UTC
Message-ID
<7vhb5ijkq0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110815232318.GA4699@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> We should perhaps call "update-index --refresh" at the start to avoid
> these sorts of false positives. Probably it should happen whenever we
> "git am --continue", as well. But for efficiency reasons, not between
> each patch.
>
> I dunno. Do people want to call "git am" in a tight loop, where the
> index refresh would be a problem? I would think they should instead feed
> a whole mbox in one go.

I am kind of surprised that we have not done the 'refresh once upfront' already and nobody ever run into this for the past 5 years. It seems that I inherited that behaviour from git-applymbox ;-)

It is sensible to refresh once at the beginning and also when restarting with "am --resolved".

Previous: Jeff KingNext: Jeff King
Message 3 of 7 in “"git apply --check" successes but git am says "does not match index"”
  1. ZemacshAug 14, 2011
  2. Jeff KingAug 15, 2011
  3. Junio C HamanoAug 15, 2011
  4. Jeff KingAug 16, 2011
  5. Junio C HamanoAug 16, 2011
  6. Jeff KingAug 16, 2011
  7. Junio C HamanoAug 16, 2011

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.