4
我在githook commit-msg
中使用這個腳本。如何在Git Tower中獲得Git Commit消息?
#!/usr/bin/python
import sys
import re
ret = 1
try:
with open(sys.argv[1]) as msg:
res = re.match("^fix gh-[0-9]+.*$", msg.readline())
if res != None:
ret = 0
except:
pass
if (ret != 0):
print("Wrong commit message. Example: 'fix gh-1234 foo bar'")
sys.exit(ret)
問題是Git Tower似乎沒有在argv
中包含任何參數。如何解決這個問題,我可以像Git Tower那樣在命令行中使用git?
這是SmartGit和其他GUI工具也是一個問題。 – prabodhprakash
這聽起來像是Git Tower中的一個bug,因爲你的鉤子看起來很好。因爲[他們聲稱鉤子應該工作](https://www.git-tower.com/help/mac/faq-and-tips/faq/hook-scripts)(雖然,信息應該打印到stderr),我請聯繫[Git Tower支持](https://www.git-tower.com/support/contact)。 – Hasturkun
檢查,聯繫支持團隊 –