git Gerrit 错误:提交主题 >65 个字符;使用较短的第一段

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30306582/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:00:53  来源:igfitidea点击:

Gerrit Error: commit subject >65 characters; use shorter first paragraph

gitgerrit

提问by Jadson Santos

We started to use the Gerrit code review recently. Sometimes when you make a simple commit and try to make a push to Gerrit, this error is displayed:

我们最近开始使用 Gerrit 代码。有时,当您进行简单的提交并尝试推送到 Gerrit 时,会显示此错误:

   remote rejected
   commit subject >65 characters; use shorter first paragraph

I looked in the web but did not find how to solve this problem. I tried to make an amend in the previous commit and reduce the size of the commit message, but the error remains.

我在网上查看,但没有找到如何解决这个问题。我试图在之前的提交中进行修改并减小提交消息的大小,但错误仍然存​​在。

What kind of error is that? And how to solve it? Is there some Gerrit configuration about the size of the commit message?

那是什么错误?以及如何解决?是否有一些关于提交消息大小的 Gerrit 配置?

回答by maggick

The first paragraph of your commit message should be 65 characters.

提交消息的第一段应为 65 个字符。

You may split it for a longer text:

您可以将其拆分为更长的文本:

initial commit message <65 chars

my long commit message with a lot of information,
Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Suspendisse metus nulla, blandit eget aliquam sed, tincidunt
nec turpis. Ut quis gravida augue, scelerisque tempor risus...

回答by hsiaoairplane

Check if you have installed commit-message-length-validatorplugin. By default, commit message max subject length is 65, max line length is 70.

检查您是否安装了commit-message-length-validator插件。默认情况下,提交消息最​​大主题长度为 65,最大行长度为 70。

You could change the default setting on gerrit.config or you could remove/disable this plugin.

您可以更改 gerrit.config 上的默认设置,也可以删除/禁用此插件。