Go 的版本控制历史:始于 SVN,钟于 Git


Go 开发团队技术 leader Russ Cox (rsc) 发文介绍了关于 Go 的版本控制历史。起因是每隔一段时间,总有人用下面这段代码表示 Go 的首次 commit 是在 1972 年:

% git log --reverse --stat
commit 7d7c6a97f815e9279d08cfaea7d5efb5e90695a8
Author: Brian Kernighan <bwk>
AuthorDate: Tue Jul 18 19:05:45 1972 -0500
Commit: Brian Kernighan <bwk>
CommitDate: Tue Jul 18 19:05:45 1972 -0500

hello, world

R=ken
DELTA=7(7 added, 0 deleted, 0 changed)

 src/pkg/debug/macho/testdata/hello.b | 7 +++++++
 1 file changed, 7 insertions(+)

...

rsc 认为这种说法十分愚蠢,于是他揭秘了关于 Go 版本控制的更多有趣历史,比如 Go 真正的首次 commit 其实是第 5 个 commit,在此之前的是假 commit。

commit 18c5b488a3b2e218c0e0cf2a7d4820d9da93a554
Author: Robert Griesemer <[email protected]>
AuthorDate: Sun Mar 2 20:47:34 2008 -0800
Commit: Robert Griesemer <[email protected]>
CommitDate: Sun Mar 2 20:47:34 2008 -0800

Go spec starting point.

SVN=111041

 doc/go_spec | 1197 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 1197 insertions(+)

据介绍,Go 使用过的版本控制系统总共有 4 个:SVN、Perforce、Mercurial 和 Git

SVN

Go 刚启动的时候使用 SVN 作为版本控制系统,据称这是因为谷歌希望通过此举评估在内部大规模推广 SVN 的可行性。最后的结果虽然没有选择 SVN,但上文提到的 Go 首次真正 commit 正是提交到了 SVN 服务器,可以说 SVN 见证了 Go 的诞生。

Perforce

2008 年 7 月,Go 在 SVN 提交了最后一次 commit,此后便转用 Perforce。

下面是 Go 迁移到 Perforce 的首次 commit:

commit 777ee7163bba96f2c9b3dfe135d8ad4ab837c062
Author: Rob Pike <[email protected]>
AuthorDate: Mon Jul 21 16:18:04 2008 -0700
Commit: Rob Pike <[email protected]>
CommitDate: Mon Jul 21 16:18:04 2008 -0700

map delete

SVN=128258

 doc/go_lang.txt | 6 ++++++
 1 file changed, 6 insertions(+)

commit 05caa7f82030327ccc9ae63a2b0121a029286501
Author: Rob Pike <[email protected]>
AuthorDate: Mon Jul 21 17:10:49 2008 -0700
Commit: Rob Pike <[email protected]>
CommitDate: Mon Jul 21 17:10:49 2008 -0700

help management of empty pkg and lib directories in perforce

R=gri
DELTA=4(4 added, 0 deleted, 0 changed)
OCL=13328
CL=13328

 lib/place-holder| 2 ++
 pkg/place-holder| 2 ++
 src/cmd/gc/mksys.bash | 0
 3 files changed, 4 insertions(+)

迁移至 Perforce 后,可以看到引入了DELTA=OCL= 和 CL= 这些标签。并且许多其他变更具有相同的OCL=CL=,如下:

commit c1f5eda7a2465dae196d1fa10baf6bfa9253808a
Author: Rob Pike <[email protected]>
AuthorDate: Mon Jul 21 18:06:39 2008 -0700
Commit: Rob Pike <[email protected]>
CommitDate: Mon Jul 21 18:06:39 2008 -0700

change date

OCL=13331
CL=13331

 doc/go_lang.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Go 在开源前的大部分开发工作都是在 Perforce 服务器上进行。

Mercurial

2009 年 10 月,Go 的版本控制系统开始切换至 Mercurial:

commit 942d6590d9005f89e971ed5af0374439a264a20e
Author: Kai Backman <[email protected]>
AuthorDate: Fri Oct 23 11:03:16 2009 -0700
Commit: Kai Backman <[email protected]>
CommitDate: Fri Oct 23 11:03:16 2009 -0700

one more argsize fix. we were copying with the correct
alignment but not enough (duh).

R=rsc
APPROVED=rsc
DELTA=16(13 added, 0 deleted, 3 changed)
OCL=36020
CL=36024

 src/cmd/5g/ggen.c |2 +-
 test/arm-pass.txt | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

commit b74fd8ecb17c1959bbf2dbba6ccb8bae6bfabeb8
Author: Kai Backman <[email protected]>
AuthorDate: Fri Oct 23 12:43:01 2009 -0700
Commit: Kai Backman <[email protected]>
CommitDate: Fri Oct 23 12:43:01 2009 -0700

fix build issue cause by transition to hg

R=rsc
http://go/go-review/1013012

 src/make-arm.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

这次的切换也是属于 11 月开源 Go 的准备工作的一部分,开发团队还需要将新的开源版权声明添加到每个文件中。rsc 表示这些工作花费了他大约一周的时间。

Git

从 2009 年 11 月到 2014 年底,由于 Google Code Project Hosting 即将关闭,Go 也不得不寻找新的代码托管方案。在研究了几个选项后,他们最终选择使用 Gerrit Code Review。许多人认为 Go 托管在 GitHub 上,但 GitHub 只是问题跟踪器的主要来源:源代码的官方主要副本位于 go.googlesource.com。

下面的 commit 见证了 Go 从 Mercurial 到 Git 的转换:

commit 94151eb2799809ece7e44ce3212aa3cbb9520849
Author: Russ Cox <[email protected]>
AuthorDate: Fri Dec 5 21:33:07 2014 -0500
Commit: Russ Cox <[email protected]>
CommitDate: Fri Dec 5 21:33:07 2014 -0500

encoding/xml: remove SyntaxError.Byte

It is unused. It was introduced in the CL that added InputOffset.
I suspect it was an editing mistake.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/182580043

 src/encoding/xml/xml.go | 1 -
 1 file changed, 1 deletion(-)

commit 258f53dee33b9055ea168cb186f8c076edee5905
Author: David Symonds <[email protected]>
AuthorDate: Mon Dec 8 13:50:49 2014 +1100
Commit: David Symonds <[email protected]>
CommitDate: Mon Dec 8 13:50:49 2014 +1100

remove .hgtags.

 .hgtags | 140 ----------------------------------------------------------------
 1 file changed, 140 deletions(-)

commit 369873c6e5d00314ae30276363f58e5af11b149c
Author: David Symonds <[email protected]>
AuthorDate: Mon Dec 8 13:50:49 2014 +1100
Commit: David Symonds <[email protected]>
CommitDate: Mon Dec 8 13:50:49 2014 +1100

convert .hgignore to .gitignore.

 .hgignore => .gitignore | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

commit f33fc0eb95be84f0a688a62e25361a117e5b995b
Author: David Symonds <[email protected]>
AuthorDate: Mon Dec 8 13:53:11 2014 +1100
Commit: David Symonds <[email protected]>
CommitDate: Mon Dec 8 13:53:11 2014 +1100

cmd/dist: convert dist from Hg to Git.

 src/cmd/dist/build.c | 100 ++++++++++++++++++++++++++++++---------------------
 1 file changed, 59 insertions(+), 41 deletions(-)

commit 26399948e3402d3512cb14fe5901afaef54482fa
Author: David Symonds <[email protected]>
AuthorDate: Mon Dec 8 11:39:11 2014 +1100
Commit: David Symonds <[email protected]>
CommitDate: Mon Dec 8 04:42:22 2014 +0000

add bin/ to .gitignore.

Change-Id: I5c788d324e56ca88366fb54b67240cebf5dced2c
Reviewed-on: https://go-review.googlesource.com/1171
Reviewed-by: Andrew Gerrand <[email protected]>

 .gitignore | 1 +
 1 file changed, 1 insertion(+)

相關推薦

2023-01-23

ion——此事一度被众人当作是愚人节的玩笑。当时集中式版本控制系统才是主流,SVN 也已经诞生了 10 多年,而分布式版本控制系统 Git 是相对较新的角色。没人能预测到分布式版本控制系统最终会统治世界,更不用说 Git 成为了

2023-07-19

eamVision 中上传和共享文档。此外,TeamVision 还支持文档的版本控制,方便团队成员追踪文档的变更历史。TeamVision 允许管理员设置文档的访问权限,以确保只有授权的团队成员能够查看和编辑文档。团队成员可以在 TeamVision 中直

2022-09-05

在 6 月 23 日冻结了 Subversion 代码树,并将对项目源代码的管理和互动迁移到了基于 Git 的 GitHub。 Git 具有许多优势,比如其天生的分布式特性、本地变更记录、作者和提交者模型等。团队称,Git 除了拥有这些优势,它在软件

2023-09-05

系统等之外,还支持多种兼容协议、多种开发语言、代码版本管理集成、低开销的实时性能分析工具等。 deepin-IDE 目前支持 C++、C、Java、Python、JavasSript 五种主流编程语言;内置语言服务器协议(LSP)、调试适配器协议(DAP)

2023-05-05

令行提供 Git 的图形界面。 目前  lazygit 发布了 0.38 版本,带来如下更改: 大变更 'x' 不再打开菜单,需要使用 '?'或重新映射键绑定。 不能再使用“y”或“n”来响应确认弹出窗口,需要使用“enter”或“esc”。 更

2022-08-13

如下: (Upcoming) breaking changes 将包含的 Bash 更新到了 5.1 版本(之前是 4.4),用户需检查自己的 shell 脚本是否有潜在的兼容性问题。 此外,Git for Windows 放弃了对 Windows Vista 的支持。大约在 2023 年初,Git for Windows 将放弃对 Windo

2023-02-11

一、更新内容简介 本次更新为次要版本更新,进行了若干优化(更新历史详见:码云 Release Nodes)。可能是市面上唯一同时支持 UDP+TCP+WebSocket 三种协议的同类开源 IM 框架。 二、MobileIMSDK 简介 MobileIMSDK 是一套专为

2023-01-17

删除文件 #10548 升级 Microsoft.VisualStudio.Composition 版本 #10546 显示文件历史记录对话框时避免双引号 #10545 如果缺少 SSH 密钥,请勿抛出 #10544 加载/存储控制台样式设置 #10532 避免在后台丢失 git 异常 #1

2023-01-12

,这可能会导致他们的软件依赖于不再存在的模块或模块版本。 对于 SourceHut 来说,代理服务会定期从源码仓库中获取 Go 软件包,以检查是否有更新。这些请求来自许多服务器,它们没有相互协调以减少其工作,并且频率可高

2022-11-04

Kate 22.12 即将推出,此版本包含多项重要变化: 支持 Qt 小部件 在即将发布的 Kate 22.12 中,支持使用任意 Qt 小部件。团队已使用它实现了新版的欢迎界面、改进的 git diff 查看器,以及配置选项现在驻留在选项卡而不是对话

2023-10-09

一、更新内容简介 本次更新为次要版本更新,进行了若干优化(更新历史详见:码云 Release Notes)。MobileIMSDK 可能是市面上唯一同时支持 UDP+TCP+WebSocket 三种协议的同类开源IM框架。 二、MobileIMSDK简介 MobileIMSDK 是一

2023-06-07

去年年底以 17% 的份额结束。今年,Python 没能保持 17% 的历史高位,回落到 13%;其他的 3 个竞争者:C、Java 和 C++ 都在逼近榜首。 他认为,Python 能否继续保持第一主要取决于人工智能的普及情况。如果像 ChatGPT 这样的工具持续

2022-04-02

Mac 的扩展稳定频道。这将在未来几天/几周内推出。” 新版本的众多变化包括有: 更新 cookie 字符串的解析以允... 本文转载自《Go+ 下个里程碑:超越 cgo,无缝对接 C 语言》,作者许式伟(@xushiwei)是七牛云创始人兼 CEO,创造了

2023-09-19

code)自定义配置(增强安全性控制)  发布安卓APK版本  自动检查更新版本 1.2 PC操作截图 主界面(功能说明) 主界面(列表模式、文件菜单) 主界面(列表模式) 手机扫码(到主界面) 手