- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
使用 strace 我注意到 git-revert 只调用两个钩子(Hook):
但是 git-commit 调用这四个:
既然 git-revert 产生了一个提交,为什么它不调用相同的钩子(Hook)作为 git-commit?
我在 Git 邮件列表中询问过这个问题,但没有得到任何回应。所以我在这里问。
当我实现一个钩子(Hook)来检测时,我最终研究了这个并拒绝恢复 merge 提交的提交,因为它们是 troublesome .
我试图将它实现为一个 commit-msg 钩子(Hook)来搜索字符串提交消息中的“这会还原提交 SHA-1”。但是 git-revert不调用 commit-msg Hook 。
所以,现在我将检查实现为预接收 Hook 。但我发现将所有预接收检查也作为预提交或提交消息 Hook ,以便我可以检测到问题提交时间而不是仅在推送时间。
最佳答案
The sequencer code actually runs git commit
to produce the commit .但是这段代码(见上面的链接)包含片段:
if (!(flags & VERIFY_MSG))
argv_array_push(&cmd.args, "-n");
这意味着它默认运行 git commit -n
。 -n
标志:
bypasses the pre-commit and commit-msg hooks
如 the git commit
documentation. 中所述设置 VERIFY_MSG
的东西是交互式 rebase “编辑”或“改写”等,但不是 git cherry-pick
。
请注意,一旦音序器完成,它将调用您的重写后 Hook (如果您有的话),因此您应该将检查放在那里。正如您所注意到的,您可以专门编辑提交消息,如果您这样做,您的提交消息 Hook 似乎应该被使用,但事实并非如此。
关于git - 为什么 git-revert 不调用 pre-commit 和 commit-msg Hook ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48852925/
注意:这与Determine number of bits in integral type at compile time非常相似,但是这是一个非常简化的版本,所有内容都包含在一个 .cpp 中 编
var err1 = Error('message'); var err2 = new Error('message'); 有什么区别?在 chrome 控制台中查看它们,它们看起来相同。对象上的相同
我有一些 jquery/php 代码,它使用 ajax 调用另一个页面。 var pall_id = $(this).attr('id'); $.ajax({ t
我当时正在开发一个在 Linux 上运行了 20 多年的遗留代码。它有3个模块,由3个不同的人处理。我只能更改一个模块。 现在我的任务是在 Windows 中构建具有最少功能的相同代码。 对于进程间通
public JsonResult Authe(string Email, string Password, bool ? Active) { var x = (from n in db.Au
var err1 = Error('message'); var err2 = new Error('message'); 有什么区别?在 Chrome 控制台中查看它们,它们看起来相同。对象上的相同
!!msg.message && msg.message 和 msg?.message 之间的区别? 第一个是当 msg 未定义时 msg.message 将不会被执行。 第二个是什么意思? 最佳答案
我正在做一个项目,我的队友和我正在讨论哪种方法更好。 在我看来Html msg似乎更通用,所以我认为我们应该尽可能使用它,但我不能给他其他理由。 另外,我来自 React 和 Redux,对我来说看起
您好,问题如下: 假设我们有链接的进程 A 和 B。进程的 A 标志 trap_exit 设置为 true。让 B 进程向 A 发送一个 msg 然后退出: PidA ! 'msg', exit(re
有没有人知道任何 JavaScript 库可以打开现有的 *.msg Outlook 文件,例如创建为模板,并可以使用代码将数据放入主题、任何其他 {} 数据并将其作为新数据保存到磁盘。消息文件? 详
我是 google protobuf 的新手,我想知道以下方法之间有什么不同: 1) foo.mutable_bar()->set_somefield(...) 和 2) nestedmsg = fo
如果我这样调用它,我会看到一个很好的差异: self.assertEqual(a, b) 如果我这样调用它,我只会看到消息: self.assertEqual(a, b, msg) 有没有简单的方法来
我是 akka 的初学者。有人可以向我解释为什么 tell 方法定义如下: receiver.tell(msg, sender); 在我看来,有人向其他人发送消息,在 OOP 中它会这样: sende
目前我的代码有 CString DisplayMessage,我的代码全部使用它在客户端和服务器之间交换 DisplayMessage。现在随着软件走向国际化,我希望 DisplayMessage 具
当我使用 Handler.dispatchMessage(msg) 时,handleMessage(Message msg) 将在新线程上运行,但是当我使用 Handler.sendMessage(
今天我遇到了一个事实,即从子线程调用的 sys.exit() 不会终止主进程。我以前不知道这一点,这没关系,但我需要很长时间才能意识到这一点。如果 sys.exit(msg) 会将 msg 打印到 s
我复制了 rabbitmq go example 并稍作改动以进行测试。 Example URL .正常工作 代码结构: func main() { //dial rabbit serve
我正在阅读 Java 9 中引入的 System.Logger API。我无法理解为什么他们开发了如此奇怪 API: System.Logger { public default void log
msg.chat.id 之间有什么区别和 msg.from.id在 Telegeram 机器人中? 显然,两者都是相同的并且返回用户ID。 bot.sendMessage(msg.chat.id, '
我目前正在学习 elm,我只是偶然发现了 div 返回 Html (String -> Msg) 而不是 Html Msg 的问题。 我收到的错误信息 这个 div 调用产生: Html (Strin
我是一名优秀的程序员,十分优秀!