{"thread":{"id":"34968","subject":"Re: git issue / [PATCH] MIPS: fix invalid symbolic link file","startedAt":"2013-09-19T13:39:20Z","lastAt":"2013-09-19T20:36:47Z","messageCount":4,"participants":["Ralf Baechle","Junio C Hamano","Johannes Sixt","Stephen Warren"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"227885","messageId":"20130919133920.GA22468@linux-mips.org","threadId":"34968","inReplyTo":"1379596148-32520-1-git-send-email-maddy@linux.vnet.ibm.com","subject":"Re: git issue / [PATCH] MIPS: fix invalid symbolic link file","fromName":"Ralf Baechle","fromEmail":"ralf@linux-mips.org","sentAt":"2013-09-19T13:39:20Z","receivedAt":"2013-09-19T13:39:20Z","isPatch":true,"sender":{"key":"ralf@linux-mips.org","avatar":null},"body":"On Thu, Sep 19, 2013 at 06:39:08PM +0530, Madhavan Srinivasan wrote:\n\n(Git folks, please read on.)\n\n>    Commit 3b29aa5ba204c created a symlink file in include/dt-bindings.\n>    Even though commit diff is fine, symlink is invalid.\n>    ls -lb shows a newline character at the end of the filename.\n> \n> lrwxrwxrwx 1 maddy maddy 35 Sep 19 18:11 dt-bindings ->\n> ../../../../../include/dt-bindings\\n\n> \n> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>\n> ---\n>  arch/mips/boot/dts/include/dt-bindings |    2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/arch/mips/boot/dts/include/dt-bindings b/arch/mips/boot/dts/include/dt-bindings\n> index 68ae388..08c00e4 120000\n> --- a/arch/mips/boot/dts/include/dt-bindings\n> +++ b/arch/mips/boot/dts/include/dt-bindings\n> @@ -1 +1 @@\n> -../../../../../include/dt-bindings\n> +../../../../../include/dt-bindings\n> \\ No newline at end of file\n> -- \n> 1.7.10.4\n\nI applied your patch - but now git-show shows it as an empty commit and\n\n  ls -lb arch/mips/boot/dts/include/dt-bindings\n\nstill shows the \\n at the end of the link target.  Things are looking ok\nnow that I manually fixed the link and commited the result.  I hope\ngit-push and git-pull are going to handle this correct.\n\nSo, I wonder if this is a git bug.\n\nThe original patch that introduced the symlink with the \\n is kernel\ncommit 3b29aa5ba204c62b3ec8f9f5b1ebd6e5d74f75d3 and is archived in\npatchwork at http://patchwork.linux-mips.org/patch/5745/  The patch\nfile contains a \\n at the end - but one would expect that from a\npatch file that has been transfered via email, so I'm not sure how this\nis supposed to work with emailed patches?!?\n\nAnyway, I'm not too fond of sylinks in the tree or in patches and I'm\nwondering if we could get rid of them for something more bullet proof.\n\n  Ralf\n"},{"id":"227888","messageId":"xmqqsix0u5re.fsf@gitster.dls.corp.google.com","threadId":"34968","inReplyTo":"20130919133920.GA22468-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org","subject":"Re: git issue / [PATCH] MIPS: fix invalid symbolic link file","fromName":"Junio C Hamano","fromEmail":"gitster-e+axbwqsrlaavxtiumwx3w@public.gmane.org","sentAt":"2013-09-19T16:37:41Z","receivedAt":"2013-09-19T16:37:41Z","isPatch":true,"sender":{"key":"gitster-e+axbwqsrlaavxtiumwx3w@public.gmane.org","avatar":null},"body":"Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org> writes:\n\n>> diff --git a/arch/mips/boot/dts/include/dt-bindings b/arch/mips/boot/dts/include/dt-bindings\n>> index 68ae388..08c00e4 120000\n>> --- a/arch/mips/boot/dts/include/dt-bindings\n>> +++ b/arch/mips/boot/dts/include/dt-bindings\n>> @@ -1 +1 @@\n>> -../../../../../include/dt-bindings\n>> +../../../../../include/dt-bindings\n>> \\ No newline at end of file\n>> -- \n>> 1.7.10.4\n>\n> I applied your patch - but now git-show shows it as an empty commit and\n>\n>   ls -lb arch/mips/boot/dts/include/dt-bindings\n>\n> still shows the \\n at the end of the link target.\n> ...\n> So, I wonder if this is a git bug.\n\nSounds as if \"git am\" is losing the important bit of information\nthat new content ends with an incomplete line.\n\nHowever, it does not reproduce for me.\n\n    $ rm -fr /var/tmp/x && mkdir /var/tmp/x && cd /var/tmp/x\n    $ git init\n    $ ln -s 'a\n    ' b\n    $ git add b\n    $ git commit -m initial\n    $ ln -f -s a b\n    $ git add b\n    $ git commit -m fix\n    $ git format-patch -1\n    $ git checkout HEAD^\n    $ git am 0001-*\n    $ git diff HEAD^ HEAD\n    diff --git a/b b/b\n    index 7898192..2e65efe 120000\n    --- a/b\n    +++ b/b\n    @@ -1 +1 @@\n    -a\n    +a\n    \\ No newline at end of file\n\nI see the same with v1.7.10 (which may not match your version;\nv1.7.10.4 is what was used by the patch submitter to prepare the\npatch, and you did not say how you are applying the patches in your\nmessage) and with more recent Git.  There is no such breakage.\n\nI briefly suspected that you might be passing \"--whitespace=fix\" to\n\"am\" and that may be incorrectly \"fixing\" the incomplete line, but\nthat is not the case.  I get the same result if I add the option to\n\"am\" in the above transcript.\n\nHow are you applying the patch?  What is your Git version?\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"227896","messageId":"523B555E.2070508@kdbg.org","threadId":"34968","inReplyTo":"20130919133920.GA22468@linux-mips.org","subject":"Re: git issue / [PATCH] MIPS: fix invalid symbolic link file","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-09-19T19:49:50Z","receivedAt":"2013-09-19T19:49:50Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 19.09.2013 15:39, schrieb Ralf Baechle:\n> The original patch that introduced the symlink with the \\n is kernel\n> commit 3b29aa5ba204c62b3ec8f9f5b1ebd6e5d74f75d3 and is archived in\n> patchwork at http://patchwork.linux-mips.org/patch/5745/  The patch\n> file contains a \\n at the end - but one would expect that from a\n> patch file that has been transfered via email, so I'm not sure how this\n> is supposed to work with emailed patches?!?\n\nThe mbox file I downloaded from this link looks like this:\n\n\narch/mips/boot/dts/include/dt-bindings | 1 +\n 1 file changed, 1 insertion(+)\n create mode 120000 arch/mips/boot/dts/include/dt-bindings\n\n\\ No newline at end of file\n\ndiff --git a/.../include/dt-bindings b/.../include/dt-bindings\nnew file mode 120000\nindex 0000000..08c00e4\n--- /dev/null\n+++ b/arch/mips/boot/dts/include/dt-bindings\n@@ -0,0 +1 @@\n+../../../../../include/dt-bindings\n\n\nbut it should look like this:\n\n\narch/mips/boot/dts/include/dt-bindings | 1 +\n 1 file changed, 1 insertion(+)\n create mode 120000 arch/mips/boot/dts/include/dt-bindings\n\ndiff --git a/.../include/dt-bindings b/.../include/dt-bindings\nnew file mode 120000\nindex 0000000..08c00e4\n--- /dev/null\n+++ b/arch/mips/boot/dts/include/dt-bindings\n@@ -0,0 +1 @@\n+../../../../../include/dt-bindings\n\\ No newline at end of file\n\n\nWhoever or whatever moved the '\\ No newline at end of file' line above\nthe patch text is to blame.\n\n-- Hannes\n"},{"id":"227899","messageId":"523B605F.8090402@wwwdotorg.org","threadId":"34968","inReplyTo":"523B555E.2070508@kdbg.org","subject":"Re: git issue / [PATCH] MIPS: fix invalid symbolic link file","fromName":"Stephen Warren","fromEmail":"swarren@wwwdotorg.org","sentAt":"2013-09-19T20:36:47Z","receivedAt":"2013-09-19T20:36:47Z","isPatch":true,"sender":{"key":"swarren@wwwdotorg.org","avatar":null},"body":"On 09/19/2013 01:49 PM, Johannes Sixt wrote:\n> Am 19.09.2013 15:39, schrieb Ralf Baechle:\n>> The original patch that introduced the symlink with the \\n is kernel\n>> commit 3b29aa5ba204c62b3ec8f9f5b1ebd6e5d74f75d3 and is archived in\n>> patchwork at http://patchwork.linux-mips.org/patch/5745/  The patch\n>> file contains a \\n at the end - but one would expect that from a\n>> patch file that has been transfered via email, so I'm not sure how this\n>> is supposed to work with emailed patches?!?\n> \n> The mbox file I downloaded from this link looks like this:\n...\n> but it should look like this:\n...\n> Whoever or whatever moved the '\\ No newline at end of file' line above\n> the patch text is to blame.\n\nThat sounds like a patchwork problem; the original copy of the message I\nreceived looks correct.\n"}]}