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

Error: "You have some suspicious patch lines"

From
BABen Aurel <ben.aurel@gmail.com>
Date
Jul 22, 2008, 07:16 UTC
Message-ID
<4885895C.5050108@gmail.com>
hi

I working on mac os x 10.5.4 (intel) with git version 1.5.5.3 and I always get this message for most of my perl scripts and also for "Makefile.pre" files:

----------- Message ---------------
* You have some suspicious patch lines:
*
* In src/scripts/trunk/3rdparty/file_sanity.pl
* trailing whitespace (line 52)
...
------------------------------------------

Editing '.git/hooks/pre-commit' and comment out the following lines (around line 58):

-- 58 if (/\s$/) { 59 bad_line("trailing whitespace", $_); 60 } --

I still have this message
----------- Message ---------------
$ git commit .
*
* You have some suspicious patch lines:
*
* In src/scripts/trunk/3rdparty/file_sanity.pl
* indent SP followed by a TAB (line 112)
-----------------------------------------
Editing '.git/hooks/pre-commit' and comment out the following lines
--
 61             if (/^\s* \t/) {
 62                 bad_line("indent SP followed by a TAB", $_);
 63             }
--
And finally "git commit" works again.

The question now is: Is it really necessary to edit the git script everytime? Is there a urgent reason why git refuses to commit because of "suspicious" lines? Is it really necessary?

Thanks ben

Next: Jeff King
Message 1 of 3 in “Error: "You have some suspicious patch lines"”
  1. Ben AurelJul 22, 2008
  2. Jeff KingJul 22, 2008
  3. Jakub NarebskiJul 22, 2008

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.