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:19 UTC
Message-ID
<20081005191903.GA13980@coredump.intra.peff.net>
In-Reply-To
<gc79f4$22m$1@ger.gmane.org>
[argh, resending with the list cc'd]
On Sat, Oct 04, 2008 at 10:28:19AM +0200, Jakub Narebski wrote:
> > Hmm. The problem is that "git apply" doesn't accept that "a/dev/null"
> > and "b/a" are the same, so it rejects them as a name. I
> 
> Shouldn't it be "/dev/null", not "a/dev/null"?  

Yes, see my recent reply to Linus elsewhere in the thread for why I didn't think it was an issue at the time (but it clearly is).

Show 10 quoted lines
> Besides git-diff(1) states:
> 
>   1. It is preceded with a "git diff" header, that looks like
>      this:
> 
>        diff --git a/file1 b/file2
> 
>      The `a/` and `b/` filenames are the same unless rename/copy is
>      involved.  Especially, even for a creation or a deletion,
>      `/dev/null` is _not_ used in place of `a/` or `b/` filenames.

And I hadn't seen this, which makes it utterly clear that the diff is broken. Thanks for pointing it out.

-Peff
Previous: Jakub NarebskiNext: Linus Torvalds
Message 4 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.