{"thread":{"id":"14587","subject":"Error: \"You have some suspicious patch lines\"","startedAt":"2008-07-22T07:16:44Z","lastAt":"2008-07-22T09:13:05Z","messageCount":3,"participants":["Ben Aurel","Jeff King","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"84290","messageId":"4885895C.5050108@gmail.com","threadId":"14587","inReplyTo":null,"subject":"Error: \"You have some suspicious patch lines\"","fromName":"Ben Aurel","fromEmail":"ben.aurel@gmail.com","sentAt":"2008-07-22T07:16:44Z","receivedAt":"2008-07-22T07:16:44Z","isPatch":false,"sender":{"key":"ben.aurel@gmail.com","avatar":null},"body":"hi\n\nI working on mac os x 10.5.4 (intel) with git version 1.5.5.3 and I \nalways get this message for most of my perl scripts and also for \n\"Makefile.pre\" files:\n\n----------- Message ---------------\n* You have some suspicious patch lines:\n*\n* In src/scripts/trunk/3rdparty/file_sanity.pl\n* trailing whitespace (line 52)\n...\n------------------------------------------\n\n\nEditing '.git/hooks/pre-commit' and comment out the following lines \n(around line 58):\n\n--\n58            if (/\\s$/) {\n59                bad_line(\"trailing whitespace\", $_);\n60             }\n--\n\nI still have this message\n\n----------- Message ---------------\n$ git commit .\n*\n* You have some suspicious patch lines:\n*\n* In src/scripts/trunk/3rdparty/file_sanity.pl\n* indent SP followed by a TAB (line 112)\n-----------------------------------------\n\nEditing '.git/hooks/pre-commit' and comment out the following lines\n--\n 61             if (/^\\s* \\t/) {\n 62                 bad_line(\"indent SP followed by a TAB\", $_);\n 63             }\n--\n\nAnd finally \"git commit\" works again.\n\nThe question now is: Is it really necessary to edit the git script \neverytime? Is there a urgent reason why git refuses to commit because of \n\"suspicious\" lines? Is it really necessary?\n\nThanks\nben\n"},{"id":"84294","messageId":"20080722072620.GA3796@sigill.intra.peff.net","threadId":"14587","inReplyTo":"4885895C.5050108@gmail.com","subject":"Re: Error: \"You have some suspicious patch lines\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-07-22T07:26:20Z","receivedAt":"2008-07-22T07:26:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jul 22, 2008 at 09:16:44AM +0200, Ben Aurel wrote:\n\n> -----------------------------------------\n>\n> Editing '.git/hooks/pre-commit' and comment out the following lines\n> --\n> 61             if (/^\\s* \\t/) {\n> 62                 bad_line(\"indent SP followed by a TAB\", $_);\n> 63             }\n> --\n>\n> And finally \"git commit\" works again.\n>\n> The question now is: Is it really necessary to edit the git script  \n> everytime? Is there a urgent reason why git refuses to commit because of  \n> \"suspicious\" lines? Is it really necessary?\n\nThe pre-commit hook that ships with git checks whitespace as an example\nof what one _could_ do with hooks. It is not meant to be enabled by\ndefault (unless you want that whitespace checking).\n\nSo either:\n\n 1. You enabled it by setting the execute bit. If so, then don't do\n    that.\n\n 2. Something is broken, and it has caused the hook to be enabled\n    accidentally. I recall somebody complaining that hooks were enabled\n    by default under cygwin because the filesystem didn't support the\n    execute bit. Are you working on an exec-bit challenged filesystem?\n\nIn newer versions of git, the hooks actually ship with a .sample\nextension so that they will not be used accidentally, regardless of the\nexecutable bit. In the meantime, it is safe to simply delete\n.git/hooks/pre-commit if it is bothering you.\n\n-Peff\n"},{"id":"84310","messageId":"m33am2wade.fsf@localhost.localdomain","threadId":"14587","inReplyTo":"4885895C.5050108@gmail.com","subject":"Re: Error: \"You have some suspicious patch lines\"","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-07-22T09:13:05Z","receivedAt":"2008-07-22T09:13:05Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ben Aurel <ben.aurel@gmail.com> writes:\n\n> I working on mac os x 10.5.4 (intel) with git version 1.5.5.3 and I\n> always get this message for most of my perl scripts and also for\n> \"Makefile.pre\" files:\n> \n> ----------- Message ---------------\n> * You have some suspicious patch lines:\n> *\n> * In src/scripts/trunk/3rdparty/file_sanity.pl\n> * trailing whitespace (line 52)\n> ...\n> ------------------------------------------\n\n> The question now is: Is it really necessary to edit the git script\n> everytime? Is there a urgent reason why git refuses to commit because\n> of \"suspicious\" lines? Is it really necessary?\n\n.git/hooks/pre-commit is example hook which helps to keep Coding Style,\nand prevents from accidentally comitting nonresolved file-level merge\nconflict (file with conflict markers).\n\nIf you want to skip running this hook once (or once upon a time), you\ncan use '-n'/'--no-verify' option to \"git commit\".  Or you can turn this\nexample hook off, either by removing execute permission from it, by\nremoving it alltogether (you can still find it in templates, usually at\n/usr/share/git-core/templates/hooks/pre-commit), or rename it adding for\nexample '.sample' or '.nonactive' suffix.\n\nThis hook should not be turned on by default, but if your filesystem is\nexecuting bit challenged it could be turned on at repository creation\ntime unintentionally.  Newer version of git use '.sample' suffix (for\nexample pre-commit.sample) instead of relying on not always reliable\nexecute bit being unset.\n\nHTH\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}