不写注释就是垃圾

news2024/9/29 3:23:52

最近Linux6.2出来了

增加了很多新的东西,有看点的是,Linux确实要可以在Apple M1上面运行了,这应该是一个很大的新闻,如果有这么稳定的硬件支持,那对于Linux来说相当于又打下了一大片的江山。

其中关于Linux6.2的特性罗列如下

  • Nouveau 中早期的 NVIDIA RTX 30/Ampere GPU 支持

  • 更新了 Zstd 压缩代码

  • 其他 Btrfs 性能增强

  • Squashfs 文件系统的新挂载选项

  • 支持 Wi-Fi 7 和 800Gbps 网络的基础工作

  • 在 exFAT 驱动程序中更快地创建文件/文件夹

  • RISC-V 对持久性内存设备的支持 

  • 英特尔 IFS 驱动程序现已稳定

  • Intel Alder Lake N/Raptor Lake P 适度节能

  • USB 4 连接唤醒/断开支持

  • 支持 ChromeOS 人体存在传感器 (HPS)

  • Raspberry Pi 4K @ 60Hz 显示支持

6.2结束后,也代表着6.3开始了,在6.3版本的合并中,Linus发针对一次提交发飙了,发飙的原因是因为有人提交代码竟然没有好好写commit

关于如何写好一个commit,之前有文章

你确定你会使用git commit?

如下链接:

https://lore.kernel.org/lkml/CAHk-=wgw++ccN-Pd1npZsBSDD3z6EGUSKsWuAEh5YC-TmfJAug@mail.gmail.com/

提交者是这样写的:

大意是说

——Linus,请把这些更新用在Linux v6.3-rc1上,涉及一些什么什么的特性,有一些围绕着虚拟子系统的其他补丁,但是这些补丁已经被其他人reviewed了。

97b3ea1ff87840e29e90118924022d6c.png

看Linus是如何回复的:

6edf7a6feea6a0c5e7be486868f3ca93.png

Linus说,我不得不再强调一次,如果你不能清楚的说明一个提交的原因,那么这次提交就显得很粗暴。

之后提交者回复如下

37e6c569936b7de07efe0980cc937c5a.png

之后,Linus还详细的解释了自己的观点

所以说,真正的大佬是超级耐心并且讲道理的,如果没有Linus,不吹,Linus被取代迟早的事。

> >I've said this before, and apparently I need to say this again: if you
> >cannot be bothered to explain *WHY* a merge exists, then that merge is
> >buggy garbage by definition.
>
> Okay, understood. This was a merge of the fixes for v6.2. I'll explain that more clearly in the log from now on. :)

So I really want people to document their merges, not just so that I
(and others) can see "oh, that's why it exists at all", but also
because I want to make people think about their merges more in
general.

For example, one reason why people do these kinds of merges is because
they are starting to do some new development for the next release, and
that new development then depends on fixes or infrastructure that they
had in another branch (like a "for-linus" branch in case of fixes).

So then they - mindlessly - just do a "git merge that-branch" and the
end result looks very much like what you sent me.

In a slightly better world, they then actually write an explanatory
commit message for that merge, knowing that I ask for them, and the
merge commit message ends up being exactly that kind of slightly odd

  "Now I'm starting a new thing that depends on the fixes
   I already sent upstream, so I'm merging that branch"

Which while certainly better than no explanation at all sounds a bit
odd, doesn't it? Yeah, add a few details on just what you depend on
and why, and it gets much better, but it's all going to be a bit
hand-wavy about future work that you haven't even written yet.

And *that* will them maybe make you then go "Ahh, I'm doing things wrong".

Because the "nice git way" to do that kind of thing is to actually
realize "oh, I'm starting new work that depends on the fixes I already
sent upstram, so I should just make a new topic branch and start at
that point that I needed".

And then - once you've done all the "new work" that depended on that
state, only at *THAT* point do you merge the topic branch.

And look - you have exactly the same commits: you have one (or more)
normal commits that implement the new feature, and you have one merge
commit, but notice how much easier it is to write the explanation for
the merge when you do it *after* the work.

Instead of having to waffle about "future work depends on this feature
that was in another branch, so I'm merging this branch", your merge
commit now makes *sense*. You're not merging some old state in order
to create new features, you are literally just merging the completed
new feature.

So *this* is one reason I want people to really think about, and
explain, their merges. Because it may be that having to explain it
makes you go "Oh, I'm doing this wrong".

Now, in your case, I don't actually think you needed that merge for
any "future new work" at all. I think you just randomly did a merge to
just get the same warning fixes that you had already sent me. So in
this case, it smells like the merge was just entirely superfluous.

Those kinds of superfluous merges can be ok - it's just annoying to
have a development branch that still shows some artifact that you
already fixed elsewhere.

But they still need the explanation. And for that case, I want the
explanation partly to make it clear that you really *thought* about
it, and partly just so that I can see why you did it.

Because we have a very real history where people did mindless daily
back-merges like this "just because" with absolutely no rhyme or
reason, just because they wanted to start each day with the most
recent base, and it really gets very ugly. The development history can
go from a DAG that actually visualizes the different development
streams nicely to a spider-net maze of inexplicable merges very
quickly.

         Linus

5cc557ff59860d35f2cf84a74400ed42.jpeg

ea71da8f79b551fdad29050553a12978.jpeg

2f3f213ba2461296dee87e117a4ff99f.jpeg

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/371067.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

cesium: 显示闪烁的点(004)

第004个 点击查看专栏目录 本示例的目的是介绍如何在vue+cesium中设置闪烁的点。主要是介绍entity>point 相关的属性设置 直接复制下面的 vue+cesium源代码,操作2分钟即可运行实现效果. 文章目录 示例效果配置方式示例源代码(共107行)相关API参考:专栏目标示例效果 配…

一个阿里P6的说不会接口自动化测试,他不会是自己评的吧...

序 近期和一个阿里的测试工程师交流了一波,他竟然说我不会接口自动化测试,我当场就不服了我说你P6自己评级的吧,今天就带大家好好盘一盘接口自动化,本着以和大家交流如何实现高效的接口测试为出发点,本文包含了我在接…

27. 移除元素 26. 删除有序数组中的重复项 88. 合并两个有序数组(双指针遍历)

目录[27. 移除元素-力扣](https://leetcode.cn/problems/remove-element/description/?languageTagsc)[26. 删除有序数组中的重复项](https://leetcode.cn/problems/remove-duplicates-from-sorted-array/)[88. 合并两个有序数组](https://leetcode.cn/problems/merge-sorted-…

Synchronized与锁升级

文章目录先从阿里及其他大厂面试题说起本章路线总纲Synchronized的性能变化synchronized锁种类及升级步骤JIT编译器对锁的优化小总结先从阿里及其他大厂面试题说起 谈谈你对synchronized的理解 synchronized锁升级你聊聊 本章路线总纲 说明: synchronized锁&a…

Java-排序链表问题

Java-排序链表问题题目题解方法:自顶向下归并排序算法题目 给你链表的头结点 head ,请将其按 升序 排列并返回 排序后的链表 。 示例 1: 示例 2: 示例 3: 提示: *链表中节点的数目在范围 [0, 5 * 104]…

Linux 练习一(常用命令的练习)

文章目录一、Linux 用户管理及文件操作第一段练习记录:主要对用户进行删除添加设置密码等操作第二段练习记录:主要包括权限设置和查找命令第三段练习记录:关于文件的命令练习第四段练习记录:查找命令及查看内存命令的使用二、Linu…

ClickHouse高可用集群分片-副本实操(四)

目录 一、ClickHouse高可用之ReplicatedMergeTree引擎 二、 ClickHouse高可用架构准备-环境说明和ZK搭建 三、高可用集群架构-ClickHouse副本配置实操 四、ClickHouse高可用集群架构分片 4.1 ClickHouse高可用架构之两分片实操 4.2 ClickHouse高可用架构之两分片建表实操 一…

AXI协议

AXI 的英文全称是 Advanced eXtensible Interface,即高级可扩展接口,它是 ARM 公司所提出的AMBA(Advanced Microcontroller Bus Architecture)协议的一部分。AXI 协议就是描述了主设备和从设备之间的数据传输方式,在该…

理解redis的数据结构

redis为什么快? 首先可以想到内存读写数据本来就快,然后IO复用快,单线程没有静态消耗和锁机制快。 还有就是数据结构的设计快。这是因为,键值对是按一定的数据结构来组织的,操作键值对最终就是对数据结构进行增删改查操…

【CSS】CSS 层叠样式表 ② ( CSS 引入方式 - 内嵌样式 )

文章目录一、CSS 引入方式 - 内嵌样式1、内嵌样式语法2、内嵌样式示例3、内嵌样式完整代码示例4、内嵌样式运行效果一、CSS 引入方式 - 内嵌样式 1、内嵌样式语法 CSS 内嵌样式 , 一般将 CSS 样式写在 HTML 的 head 标签中 ; CSS 内嵌样式 语法如下 : <head><style …

2.25测试对象分类

一.按照测试对象划分1.界面测试又称UI测试,按照界面的需求(一般是ui设计稿)和界面的设计规则,对我们软件界面所展示的全部内容进行测试和检查.对于非软件来说:颜色,大小,材质,整体是否美观对于软件来说:输入框,按钮,文字,图片...的尺寸,颜色,形状,整体适配,清晰度等等,2.可靠性…

【AcWing-Python-786】第k个数/快速选择算法

题目&#xff1a;https://www.acwing.com/problem/content/788/对应视频讲解&#xff1a;https://www.acwing.com/video/228/题目描述回顾快排【AcWing-Python-785】快速排序 - CSDN博客&#xff08;一&#xff09;步骤找到分界点x&#xff1a;可以是区间最左端点、区间最右端点…

java String类(超详细,含常用方法、面试题,内存图,案例)

String类一、String类的特点二、String 类的常见构造方法三、String常见的面试题1.字符串常量池2.String s "abc"与String s new String("abc")区别3.字符拼接4.常量优化机制四、String常用方法1. 比较字符串内容2. 遍历字符串3.截取字符串4.替换字符串5…

Linux-常见命令

&#x1f69c;关注博主&#xff1a;翻斗花园代码手牛爷爷 &#x1f699;Gitee仓库&#xff1a;牛爷爷爱写代码 目录&#x1f692;xshell热键&#x1f697;Linux基本命令&#x1f697;ls指令&#x1f695;pwd指令&#x1f696;cd指令&#x1f68c;touch指令&#x1f68d;mkdir指…

C++11多线程编程 一:多线程概述

1.1 第一个线程代码示例-线程创建示例 多线程编程当中&#xff0c;每一个程序运行都至少会有一个线程&#xff0c;一般的main函数都作为主线程的入口&#xff0c;这里面是一个进程包含一个主线程&#xff0c;一个进程里面包含多个子线程&#xff0c;所以一般在主线程当中(也就是…

【离线数仓-8-数据仓库开发DWD层设计要点-交易域相关事实表】

离线数仓-8-数据仓库开发DWD层设计要点-交易域相关事实表离线数仓-8-数据仓库开发DWD层设计要点-交易域相关事实表一、DWD层设计要点二、交易域相关事实表1.交易域加购事务事实表1.加购事务事实表 前期梳理2.加购事务事实表 DDL表设计分析3.加购事务事实表 加载数据分析1.首日全…

Nginx 和 Tomcat 实现负载均衡

Nginx 和 tomcat 实现负载均衡 &#x1f3c6;荣誉认证&#xff1a;51CTO博客专家博主、TOP红人、明日之星&#xff1b;阿里云开发者社区专家博主、技术博主、星级博主。 &#x1f4bb;微信公众号&#xff1a;微笑的段嘉许 &#x1f4cc;本文由微笑的段嘉许原创&#xff01; &am…

【模拟集成电路】电荷泵(CP)设计

电荷泵&#xff08;CP&#xff09;设计前言一、电荷泵&#xff08;CP&#xff09;原理&#xff08;1&#xff09;电流失配问题&#xff08;2&#xff09;开关管的时钟馈通问题&#xff08;3&#xff09;电荷注入问题二、电荷泵&#xff08;CP&#xff09;电路三、电荷泵性能测试…

springboot+jersey+tomcat实现跨域方式上传文件到服务器

前言 在服务器上&#xff0c;当我们启动了tomcat&#xff0c;就可以以 http://ip地址:8080/文件路径/文件名 的方式&#xff0c;进行访问到我们服务器上处于tomcat的webapps文件夹下的文件 于是为了可以往上面加文件&#xff0c;我们有两种方式&#xff0c;一种就是直接复制文…

ABAP 辨析CO|CN|CA|NA|CS|NS|CP|NP

1、文档说明 本篇文档将通过举例&#xff0c;解析字符的比较运算符之间的用法和区别&#xff0c;涉及到的操作符&#xff1a;CO|CN|CA|NA|CS|NS|CP|NP 2、用法和区别 用法总览 以下举例&#xff0c;几乎都使用一个字符变量和一个硬编码字符进行对比的方式&#xff0c;忽略尾…