我期待防止提交到我的本地Windows水銀回購,如果下面的字符串出現在任何未提交的文件:如何防止Windows上的Mercurial Commits包含字符串?
不承諾ME
我知道,預提交hook I need是pretxncommit
。如果我是在Linux上我只想做這樣的事情:
[hooks]
pretxncommit.donotcommitme = hg export tip | (! grep -E -q -i 'do not commit me')
(從this link採取但未驗證/測試)
至於egrep的,我有FINDSTR /I /C:"do not commit"
,替代它似乎工作精細。然而,我找不到任何東西來「否定」它的結果,就像在上面的Linux例子中一樣。
作爲純命令提示符命令的一種可能的替代方法,我也碰到了檢查大二進制文件的this PowerShell script。但是我不知道PowerShell,所以這整個事情對我來說看起來很亂。
有沒有人知道一個簡單的方法來做我沒有安裝Python,Cygwin或其他什麼?或者你知道如何修改上面的PowerShell腳本來進行字符串檢查而不是檢查文件大小嗎?
我們也在使用TortoiseHG,所以任何解決方案都可以使用它來代替純粹的Mercurial。