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

Re: being nice to patch(1)

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 3, 2007, 00:28 UTC
Message-ID
<alpine.LFD.0.98.0707021713200.9434@woody.linux-foundation.org>
In-Reply-To
<20070702145601.a0dcef0f.akpm@linux-foundation.org>
On Mon, 2 Jul 2007, Andrew Morton wrote:
> 
> I'm afraid indenting the changelog with leading spaces doesn't help -
> patch(1) still tries to apply the diff.
Oh wow. I didn't believe you, so I decided to test.
I shouldn't have doubted you.

That also explains why it reacted to that 53c700 even though it wasn't at the beginning of a line.

That really is a piece of crap.

People who think that basic programs like "patch" should DWIM stuff like that are incompetent. Yes, I can see how it can be "convenient", but dammit, whoever added that convenince feature really is a total moron.

At the very least it should be off by default, and controlled by some flag (ie "patch --dwim"). As it is, it's on by default, and I don't see any way at all to disable it (not in the man-page, and not googling the source with google code-search).

That's just incredibly broken.

I guess I shouldn't be surprised. The whole "things should be convenient, not safe" approach is shown by the default high fuzz-factor too. But at least that one you can disable.

It's positively microsoftian to make programs blindly be "convenient", with no thinking about what that means for security and safety of the end result.

So I would suggest that in quilt and other systems, you either:
 - strip all headers manually
 - forget about "patch", and use "git-apply" instead that does things 
   right and doesn't screw up like this (and can do rename diffs etc too).

I guess the second choice generally isn't an option, but dammit, "git-apply" really is the better program here.

		Linus
Previous: Andrew MortonNext: Junio C Hamano
Message 6 of 32 in “being nice to patch(1)”
  1. Andrew MortonJul 2, 2007
  2. Linus TorvaldsJul 2, 2007
  3. Andrew MortonJul 2, 2007
  4. Linus TorvaldsJul 2, 2007
  5. Andrew MortonJul 2, 2007
  6. Linus TorvaldsJul 3, 2007
  7. Junio C HamanoJul 3, 2007
  8. Linus TorvaldsJul 3, 2007
  9. Johannes SchindelinJul 3, 2007
  10. Paolo CiarrocchiJul 3, 2007
  11. Johannes SchindelinJul 3, 2007
  12. Theodore TsoJul 3, 2007
  13. Linus TorvaldsJul 3, 2007
  14. Paul EggertJul 3, 2007
  15. Linus TorvaldsJul 3, 2007
  16. Linus TorvaldsJul 3, 2007
  17. David KastrupJul 3, 2007
  18. Johannes SchindelinJul 3, 2007
  19. David KastrupJul 3, 2007
  20. diff --no-index: fix --name-status with added filesJohannes Schindelin, Jul 3, 2007
  21. Johannes SchindelinJul 3, 2007
  22. David KastrupJul 3, 2007
  23. David KastrupJul 6, 2007
  24. git-diff memory/speed/disk impacts (was: being nice to patch(1))David Kastrup, Jul 6, 2007
  25. Linus TorvaldsJul 6, 2007
  26. Andreas GruenbacherJul 3, 2007
  27. Andrew MortonJul 3, 2007
  28. Linus TorvaldsJul 3, 2007
  29. Andreas GruenbacherJul 3, 2007
  30. Andrew MortonJul 3, 2007
  31. Andrew MortonJul 3, 2007
  32. Andrew MortonJul 3, 2007

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.