tag:blogger.com,1999:blog-3494795920779884230.post3330856656581618389..comments2024-01-30T07:20:56.194+01:00Comments on michael.gr: Preventing a file from being committed if it contains a certain keywordmichael.grhttp://www.blogger.com/profile/08912489839290044913noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-3494795920779884230.post-36367548754525963372015-04-17T21:17:29.713+02:002015-04-17T21:17:29.713+02:00Good call Michael: http://stackoverflow.com/questi...Good call Michael: http://stackoverflow.com/questions/29707649/svn-pre-commit-hook-how-to-block-a-keyword-in-certain-file-typesBenhttps://www.blogger.com/profile/11653098964382668208noreply@blogger.comtag:blogger.com,1999:blog-3494795920779884230.post-17534867751924317482015-04-17T20:38:00.632+02:002015-04-17T20:38:00.632+02:00I do not know, Ben. But it sounds like a good ques...I do not know, Ben. But it sounds like a good question for stackoverflow.commichael.grhttps://www.blogger.com/profile/08912489839290044913noreply@blogger.comtag:blogger.com,1999:blog-3494795920779884230.post-47155193128998734512015-04-17T18:47:08.668+02:002015-04-17T18:47:08.668+02:00This is soooo close to what I need, but not quite ...This is soooo close to what I need, but not quite there. For some reason, I've been unable to do what I need, which is check for existence of a keyword in only certain filetypes. For instance, I do not want to allow .java files to have "http://" or "https://" in them. I've tried using --include=*\.java but it seems to get ignored in my pre-commit file (works fine on Benhttps://www.blogger.com/profile/11653098964382668208noreply@blogger.comtag:blogger.com,1999:blog-3494795920779884230.post-11446090131740048082014-05-13T19:22:40.116+02:002014-05-13T19:22:40.116+02:00Thank you for contributing, Georgi!Thank you for contributing, Georgi!michael.grhttps://www.blogger.com/profile/08912489839290044913noreply@blogger.comtag:blogger.com,1999:blog-3494795920779884230.post-5360043066064038322014-05-13T19:00:18.847+02:002014-05-13T19:00:18.847+02:00Hi Michael,
Thank you for the great article That&...Hi Michael,<br /><br />Thank you for the great article That's what I needed. Just a few notes on the linux script:<br /><br />1. svnlook command should be "diff", not "log".<br />2. There should be opening bracket before "echo".<br />3. I only got it to work when I added "exit 0;" at the end of the file.<br /><br />So my working script looks like:<br />Georginoreply@blogger.com