您现在的位置是:亿华云 > 应用开发

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

亿华云2025-10-03 02:36:48【应用开发】1人已围观

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

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

% git log --reverse --stat

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

commit 7d7c6a97f815e9279d08cfaea7d5efb5e90695a8

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

Author: Brian Kernighan

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

AuthorDate: Tue Jul 18 19:05:45 1972 -0500

Commit: Brian Kernighan

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

AuthorDate: Sun Mar 2 20:47:34 2008 -0800

Commit: Robert Griesemer

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 c1f5eda7a2465dae196d1fa10baf6bfa9253808a

Author: Rob Pike

AuthorDate: Mon Jul 21 18:06:39 2008 -0700

Commit: Rob Pike

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(-)

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

commit 942d6590d9005f89e971ed5af0374439a264a20e

Author: Kai Backman

AuthorDate: Fri Oct 23 11:03:16 2009 -0700

Commit: Kai Backman

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

AuthorDate: Fri Oct 23 12:43:01 2009 -0700

Commit: Kai Backman

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

AuthorDate: Fri Dec 5 21:33:07 2014 -0500

Commit: Russ Cox

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

AuthorDate: Mon Dec 8 13:50:49 2014 +1100

Commit: David Symonds

CommitDate: Mon Dec 8 13:50:49 2014 +1100

remove .hgtags.

.hgtags | 140 ----------------------------------------------------------------

1 file changed, 140 deletions(-)

commit 369873c6e5d00314ae30276363f58e5af11b149c

Author: David Symonds

AuthorDate: Mon Dec 8 13:50:49 2014 +1100

Commit: David Symonds

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

AuthorDate: Mon Dec 8 13:53:11 2014 +1100

Commit: David Symonds

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

AuthorDate: Mon Dec 8 11:39:11 2014 +1100

Commit: David Symonds

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

.gitignore | 1 +

1 file changed, 1 insertion(+)

​​点此查看更多介绍。​​

本文转自OSCHINA

本文标题:Go 的版本控制历史:始于 SVN,源码下载钟于 Git

本文地址:https://img.ydisp.cn/news/20220902/uknpsfbkqtl

很赞哦!(4937)