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

Re: git apply: git diff header lacks filename information for git diff --no-index patch

From
Jeff King <peff@peff.net>
Date
Oct 5, 2008, 19:24 UTC
Message-ID
<20081005192439.GD6173@coredump.intra.peff.net>
In-Reply-To
<20081005191728.GA6173@coredump.intra.peff.net>
On Sun, Oct 05, 2008 at 03:17:28PM -0400, Jeff King wrote:
Show 6 quoted lines
> Yes, I noticed that, as well. And obviously it looks bogus, but I
> thought I managed to get "git diff" to produce "a/dev/null" on some
> otherwise valid input, and so assumed that was something we were able to
> work around in applying the patch. But testing again today, I can't seem
> to get anything except this broken diff to say "a/dev/null". So probably
> I was just mistaken yesterday.

Ah, I found it. It was the fact that _text_ diffs using --no-index also generate that bogosity. But of course they work fine, since we just reject the "default" name from the "diff --git" line, but end up getting the names from the "---" and "+++" lines.

-Peff
Previous: Jeff King
Message 10 of 10 in “git apply: git diff header lacks filename information for git diff --no-index patch”
  1. Imre DeakOct 2, 2008
  2. Jeff KingOct 4, 2008
  3. Jakub NarebskiOct 4, 2008
  4. Jeff KingOct 5, 2008
  5. Linus TorvaldsOct 4, 2008
  6. Linus TorvaldsOct 4, 2008
  7. Linus TorvaldsOct 4, 2008
  8. Jeff KingOct 5, 2008
  9. Jeff KingOct 5, 2008
  10. Jeff KingOct 5, 2008

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.