Skip to contentSkip to conversation

DOS filetype and pre_commit hook

BUG MALET Jean-Luc 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

Signature · 3 lines
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!"