[BUG] DOS filetype and pre_commit hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I use git for tracking change on the project I'm working on and the sourcecode is in dos text encoding (<CR><LF>) when I commit I have to use the --no-verify option because the perl part of the hook (btw isn't it possible to have git not depend on perl?) don't use the right regexp to track if there is trailing whitespace
the corresponding regex to be used with grep is :
grep -E '^\+.*[[:blank:]]+[[:space:]]$'

because <CR> is matched by [[:space:]] and then a line like :

no trailing whitespace<CR><LF>

will trigger a trailing whitespace event

See the attached file that correct the issue

Best Regards,
JLM

--
KISS! (Keep It Simple, Stupid!)
(garde le simple, imbécile!)
"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses simples et qui marchent, espèce d'imbécile!"

Attachment: pre-commit
Description: Binary data


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux