{"thread":{"id":"20594","subject":"trailling whitespace with git am ?","startedAt":"2009-08-14T10:42:52Z","lastAt":"2009-08-14T20:46:43Z","messageCount":5,"participants":["PICCA Frédéric-Emmanuel","Alex Riesen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"120631","messageId":"606CC410B038E34CB97646A32D0EC0BF0181FAB4@venusbis.synchrotron-soleil.fr","threadId":"20594","inReplyTo":null,"subject":"trailling whitespace with git am ?","fromName":"PICCA Frédéric-Emmanuel","fromEmail":"frederic-emmanuel.picca@synchrotron-soleil.fr","sentAt":"2009-08-14T10:42:52Z","receivedAt":"2009-08-14T10:42:52Z","isPatch":false,"sender":{"key":"frederic-emmanuel.picca@synchrotron-soleil.fr","avatar":null},"body":"hello\n\nI attached a patch that someone sent to me\nthe public repository is\nhttp://repo.or.cz/w/diffractometer.git\n\nthis patch must be apply on the next branch\n\nbut when I try to use\ngit am, I have this sort of message:\n\nmordor% git am /home/picca/Projets/patches/0001-Add-the-POGO-TO-DELETE-comment-to-ComputedAnglesClea.patch \nApplying: 'Add the POGO TO DELETE comment to ComputedAnglesClear command'\n/tmp/diffractometer/.git/rebase-apply/patch:13: trailing whitespace.\n\n/tmp/diffractometer/.git/rebase-apply/patch:14: trailing whitespace.\n\t/* POGO TO DELETE */\nerror: patch failed: src/Diffractometer/Diffractometer.cpp:2023\nerror: src/Diffractometer/Diffractometer.cpp: patch does not apply\nPatch failed at 0001 'Add the POGO TO DELETE comment to ComputedAnglesClear command'\nWhen you have resolved this problem run \"git am --resolved\".\nIf you would prefer to skip this patch, instead run \"git am --skip\".\nTo restore the original branch and stop patching run \"git am --abort\".\n\n\nso git do not want to apply it.\n\nI was looking in the patch file about thoses trailing whitespace but I found nothing\nuntil I rewrote myself this complicate patch :)\nthen I produced a diff beetween my patch and the original one.\n\nI also attached it.\nusing emacs/vi I saw immediately the problem... It was a dos/unix file format problem. So the first message of git am was no helpfull at all for me. It would be nice to detect this format\nproblem when applying the patch and says something like\nthis patch is in dos format on an unix platform I can not apply it.\n\nthe a short explaination of what solution are possibles for the users.\n\nnow the question is:\n\nwhat must I tell to that person if I want to work with her (as she is charming the forget about here is a no op :))\nchange your editor or is it a git configuration problem ? I suppose she is using msygit but I can not affirm this.\n\nthanks\n\nFrédéric\n\n\n\nFrom 2ad19d21660e7a94cba0e7eaedbb867208832ca2 Mon Sep 17 00:00:00 2001\nFrom: teresa <tnunez@mail.desy.de>\nDate: Fri, 14 Aug 2009 10:46:09 +0200\nSubject: [PATCH] 'Add the POGO TO DELETE comment to ComputedAnglesClear command'\n\n---\n src/Diffractometer/Diffractometer.cpp |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/src/Diffractometer/Diffractometer.cpp b/src/Diffractometer/Diffractometer.cpp\nindex 5d2a55d..98add35 100644\n--- a/src/Diffractometer/Diffractometer.cpp\n+++ b/src/Diffractometer/Diffractometer.cpp\n@@ -2023,6 +2023,8 @@ void Diffractometer::computed_angles_clear()\n \tDEBUG_STREAM << \"Diffractometer::computed_angles_clear(): entering... !\" << endl;\n \n \t//\tAdd your own code to control device here\n+\n+\t/* POGO TO DELETE */\n \t_computedAngles_size = 0;\n \tif(attr_ComputedAngles_read) {\n \t\tdelete [] attr_ComputedAngles_read;\n-- \n1.6.4\n\n\n\n1,25c1,25\n< From 58ed93432f043ee5b2ad44d92a769eddcef4cffa Mon Sep 17 00:00:00 2001\n< From: =?utf-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca@synchrotron-soleil.fr>\n< Date: Fri, 14 Aug 2009 12:10:50 +0200\n< Subject: [PATCH] * test\n< \n< ---\n<  src/Diffractometer/Diffractometer.cpp |    2 ++\n<  1 files changed, 2 insertions(+), 0 deletions(-)\n< \n< diff --git a/src/Diffractometer/Diffractometer.cpp b/src/Diffractometer/Diffractometer.cpp\n< index 5d2a55d..98add35 100644\n< --- a/src/Diffractometer/Diffractometer.cpp\n< +++ b/src/Diffractometer/Diffractometer.cpp\n< @@ -2023,6 +2023,8 @@ void Diffractometer::computed_angles_clear()\n<  \tDEBUG_STREAM << \"Diffractometer::computed_angles_clear(): entering... !\" << endl;\n<  \n<  \t//\tAdd your own code to control device here\n< +\n< +\t/* POGO TO DELETE */\n<  \t_computedAngles_size = 0;\n<  \tif(attr_ComputedAngles_read) {\n<  \t\tdelete [] attr_ComputedAngles_read;\n< -- \n< 1.6.3.3\n< \n---\n> From 2ad19d21660e7a94cba0e7eaedbb867208832ca2 Mon Sep 17 00:00:00 2001\n> From: teresa <tnunez@mail.desy.de>\n> Date: Fri, 14 Aug 2009 10:46:09 +0200\n> Subject: [PATCH] 'Add the POGO TO DELETE comment to ComputedAnglesClear command'\n> \n> ---\n>  src/Diffractometer/Diffractometer.cpp |    2 ++\n>  1 files changed, 2 insertions(+), 0 deletions(-)\n> \n> diff --git a/src/Diffractometer/Diffractometer.cpp b/src/Diffractometer/Diffractometer.cpp\n> index 5d2a55d..98add35 100644\n> --- a/src/Diffractometer/Diffractometer.cpp\n> +++ b/src/Diffractometer/Diffractometer.cpp\n> @@ -2023,6 +2023,8 @@ void Diffractometer::computed_angles_clear()\n>  \tDEBUG_STREAM << \"Diffractometer::computed_angles_clear(): entering... !\" << endl;\n>  \n>  \t//\tAdd your own code to control device here\n> +\n> +\t/* POGO TO DELETE */\n>  \t_computedAngles_size = 0;\n>  \tif(attr_ComputedAngles_read) {\n>  \t\tdelete [] attr_ComputedAngles_read;\n> -- \n> 1.6.4\n> \n"},{"id":"120651","messageId":"81b0412b0908141310x7e4acf4fgf4ea71cf53de6eea@mail.gmail.com","threadId":"20594","inReplyTo":"606CC410B038E34CB97646A32D0EC0BF0181FAB4@venusbis.synchrotron-soleil.fr","subject":"Re: trailling whitespace with git am ?","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2009-08-14T20:10:09Z","receivedAt":"2009-08-14T20:10:09Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"2009/8/14 PICCA Frédéric-Emmanuel\n<frederic-emmanuel.picca@synchrotron-soleil.fr>:\n> mordor% git am /home/picca/Projets/patches/0001-Add-the-POGO-TO-DELETE-comment-to-ComputedAnglesClea.patch\n> Applying: 'Add the POGO TO DELETE comment to ComputedAnglesClear command'\n> /tmp/diffractometer/.git/rebase-apply/patch:13: trailing whitespace.\n>\n> /tmp/diffractometer/.git/rebase-apply/patch:14: trailing whitespace.\n>        /* POGO TO DELETE */\n> error: patch failed: src/Diffractometer/Diffractometer.cpp:2023\n> error: src/Diffractometer/Diffractometer.cpp: patch does not apply\n\nThis patch has DOS line endings (like CR, followed by LF).\n\nYou can either use dos2unix (or your editor of choice), or update your git\nto current master branch, where \"git am\" handles such patches transparently.\n"},{"id":"120652","messageId":"606CC410B038E34CB97646A32D0EC0BF0181FABD@venusbis.synchrotron-soleil.fr","threadId":"20594","inReplyTo":"81b0412b0908141310x7e4acf4fgf4ea71cf53de6eea@mail.gmail.com","subject":"RE : trailling whitespace with git am ?","fromName":"PICCA Frédéric-Emmanuel","fromEmail":"frederic-emmanuel.picca@synchrotron-soleil.fr","sentAt":"2009-08-14T20:21:05Z","receivedAt":"2009-08-14T20:21:05Z","isPatch":false,"sender":{"key":"frederic-emmanuel.picca@synchrotron-soleil.fr","avatar":null},"body":"> This patch has DOS line endings (like CR, followed by LF).\n\n> You can either use dos2unix (or your editor of choice), or update your git\n> to current master branch, where \"git am\" handles such patches transparently.\n\nI am using git 1.6.3.3 debian unstable is it ok ?\n\nIn fact we saw that this problem was due to our webmail\n\nthe patch was attached to a mail and using the webmail interface a save to disk transform the CR -> CR LF\n\nwe tested it with gmail and the microsoft webmail\n\nnow the problem is that a patch with CR+ LF do not have the same signature that a patch\nwith  only CR.\n\nhow can I do the difference between a patch with normal CR+LF (the autor use this format)\nand a patch without CR+LF due to the webmail ?\n\nSee you\n\nFrederic\n"},{"id":"120656","messageId":"7vab22i1dl.fsf@alter.siamese.dyndns.org","threadId":"20594","inReplyTo":"606CC410B038E34CB97646A32D0EC0BF0181FABD@venusbis.synchrotron-soleil.fr","subject":"Re: RE : trailling whitespace with git am ?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-14T20:31:02Z","receivedAt":"2009-08-14T20:31:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"PICCA Frédéric-Emmanuel  <frederic-emmanuel.picca@synchrotron-soleil.fr>\nwrites:\n\n> how can I do the difference between a patch with normal CR+LF (the autor use this format)\n> and a patch without CR+LF due to the webmail ?\n\nThat is a question to your webmail provider but I think you generally\ncan't.  Use dos2unix as Alex suggested and you should be fine.\n"},{"id":"120658","messageId":"606CC410B038E34CB97646A32D0EC0BF0181FABE@venusbis.synchrotron-soleil.fr","threadId":"20594","inReplyTo":"7vab22i1dl.fsf@alter.siamese.dyndns.org","subject":"RE : RE : trailling whitespace with git am ?","fromName":"PICCA Frédéric-Emmanuel","fromEmail":"frederic-emmanuel.picca@synchrotron-soleil.fr","sentAt":"2009-08-14T20:46:43Z","receivedAt":"2009-08-14T20:46:43Z","isPatch":false,"sender":{"key":"frederic-emmanuel.picca@synchrotron-soleil.fr","avatar":null},"body":"> how can I do the difference between a patch with normal CR+LF (the autor use this format)\n> and a patch without CR+LF due to the webmail ?\n\n> That is a question to your webmail provider but I think you generally\n> can't.  Use dos2unix as Alex suggested and you should be fine.\n\ngit am --whitespace=fix was sufficient to apply the patch\n"}]}