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

Kernel bug caused by 'git apply' misapplying a patch with ambiguous chunk

From
MPMikko Perttunen <mikko.perttunen@kapsi.fi>
Date
Apr 2, 2015, 15:25 UTC
Message-ID
<551D5F58.4010201@kapsi.fi>
Hello everyone,

we recently ran into a kernel bug caused by git misapplying this patch: https://lkml.org/lkml/2014/7/3/896 .

The chunk '@@ -653,6 +655,7 @@' in tegra124.dtsi (the second file in the patch) has ambiguous context (there are several almost identical PHY nodes in the file). Git applied the chunk to the second PHY node when it should have been applied to the first node.

You can reproduce this by checking out, for example, version 3.16 of the Linux kernel and applying the patch from the above link and then looking at

   arch/arm/boot/dts/tegra124.dtsi

and verifying that git has added the 'nvidia,has-utmi-pad-registers' property to the second, instead of the first 'phy' node.

Of course this is probably rather hard to fix on the applying end; but perhaps format-patch could check for ambiguous chunks and either warn the user or increase the context size automatically, or apply could warn about the chunk being ambiguous?

Thanks, Mikko Perttunen

Next: Junio C Hamano
Message 1 of 3 in “Kernel bug caused by 'git apply' misapplying a patch with ambiguous chunk”
  1. Mikko PerttunenApr 2, 2015
  2. Junio C HamanoApr 2, 2015
  3. Mikko PerttunenApr 2, 2015

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.