表示和数据的分离在这里驱动了我的提交消息。
您的提交消息不应以任何字符数进行硬包装,而应使用换行符将想法,段落等分隔为数据的一部分,而不是表示的一部分。在这种情况下,“数据”是您试图传达的消息,而“演示”是用户如何看待它。
我在顶部使用一个汇总行,并尽量使其简短,但我不限制自己为任意数。如果Git实际上提供了一种方法来将摘要消息存储为与消息分开的实体,那会好得多,但是由于不必这样做,因此我不必侵入其中,而是使用第一行换行符作为分隔符(幸运的是,许多工具都支持这意味着拆分数据)。
对于消息本身,换行符表示数据中有意义的内容。单个换行符指示列表中的开始/中断,而双换行符指示新的思想/想法。
This is a summary line, try to keep it short and end with a line break.
This is a thought, perhaps an explanation of what I have done in human readable format. It may be complex and long consisting of several sentences that describe my work in essay format. It is not up to me to decide now (at author time) how the user is going to consume this data.
Two line breaks separate these two thoughts. The user may be reading this on a phone or a wide screen monitor. Have you ever tried to read 72 character wrapped text on a device that only displays 60 characters across? It is a truly painful experience. Also, the opening sentence of this paragraph (assuming essay style format) should be an intro into the paragraph so if a tool chooses it may want to not auto-wrap and let you just see the start of each paragraph. Again, it is up to the presentation tool not me (a random author at some point in history) to try to force my particular formatting down everyone else's throat.
Just as an example, here is a list of points:
* Point 1.
* Point 2.
* Point 3.
这是软包装文本的查看器中的外观。
这是一个摘要行,请尝试使其简短并以换行符结尾。
这是一个想法,也许是我以人类可读格式所做的解释。它可能很复杂,而且很长,由几个以论文格式描述我的作品的句子组成。我现在不能决定(在作者时)用户将如何使用此数据。
两个换行符将这两个想法分开。用户可能正在电话或宽屏监视器上阅读此内容。您是否曾经尝试在只能显示60个字符的设备上阅读72个字符的自动换行符?这是一次真正的痛苦经历。另外,该段落的开头句子(假设论文样式格式)应该是该段落的简介,因此,如果工具选择它,可能不希望自动换行,而只看到每个段落的开头。再次,由展示工具而不是我(在历史上某个时候是一位随机作者)来试图迫使我采用特定的格式来降低所有人的痛苦。
举例来说,这里是一个点列表:
*点1.
*点2.
*点3。
我的怀疑是,您链接的Git提交消息推荐的作者之前从未编写过供不同终端(例如,网站)使用不同设备的大量最终用户使用的软件,因为在这一点上软件/计算的发展众所周知,就用户体验而言,使用硬编码的演示信息存储数据是一个坏主意。