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

[BUG] DOS filetype and pre_commit hook

From
MJMALET Jean-Luc <jeanluc.malet@gmail.com>
Date
Feb 6, 2008, 22:22 UTC
Message-ID
<47AA333A.8040403@gmail.com>

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!"
Message 1 of 1 in “[BUG] DOS filetype and pre_commit hook”
  1. MALET Jean-LucFeb 6, 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.