Git commit You have suspicious patch lines

git commit giving me the following message

 * * You have some suspicious patch lines: * * In projects/bong/traid/apps/controller/project.php * trailing whitespace (line 220) projects/bong/traid/apps/controller/project.php:220: * trailing whitespace (line 223) 

What does it mean?

+7
source share
3 answers

This happens when the file has a trailing space, if you run:

 git commit --no-verify 

It will be fixed normally. ref

+14
source

It seems to me that just disabling pre-commit. If you look at the contents of .git / hooks / pre-commit, it also checks for unresolved merge conflicts, and I would like to continue checking them!

At the end of the file, it runs several regular expressions that check for spaces at the end of the line and untidy tabs. I just commented on these lines so that they would not look for them, and I got rid of the warning problem before committing.

 55 if (s/^\+//) { 56 $lineno++; 57 chomp; **58 # if (/\s$/) { 59 # bad_line("trailing whitespace", $_); 60 # } 61 # if (/^\s* \t/) { 62 # bad_line("indent SP followed by a TAB", $_); 63 # }** 64 if (/^([])\1{6} |^={7}$/) { 65 bad_line("unresolved merge conflict", $_); 66 } 67 } 
+7
source

In short, this means that you have a space on the specified lines. Running white is a bit of a strange choice, and sometimes a compiler error or other error.

You can either clear these lines, or you can force the commit only this time by adding the -no-verify flag to your git commit.

Alternatively, you can simply disable this check by disabling catch hooks, for example: cd.git / hooks / chmod -x pre-commit

By the way, this answer is extracted from: http://danklassen.com/wordpress/2008/12/git-you-have-some-suspicious-patch-lines/

+1
source

All Articles