Git 第一版源代码

2020-10-10 17:09:24 +08:00
 jatsz

https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23ca2e25604af290

猛一看有种错觉:就这?我也能写。

4380 次点击
所在节点    程序员
16 条回复
Loserzhu
2020-10-10 17:28:11 +08:00
一种错觉,最近好多文章都在写 git 第一版源码。
第一个是看的阿里技术发的文,然后就铺天盖地的 git 第一版。
tao1991123
2020-10-10 17:31:11 +08:00
git 的第一行代码 怎么会使用 git 进行管理呢?
luassuns
2020-10-10 18:07:57 +08:00
@tao1991123 #2 写完第一版后,再一把 commit 就行了呀
hutusi
2020-10-10 18:55:59 +08:00
@Loserzhu 我也写了一篇:-) 阿里的文章我也看了,但实际上我写的更早一个月,只不过先发在了公司内网里 😪
codehz
2020-10-10 19:07:45 +08:00
然后这玩意被刷了几百条评论
littlewing
2020-10-10 19:19:40 +08:00
@tao1991123 你这个问题类似于怎么用 go 写 go
qwerthhusn
2020-10-10 19:53:28 +08:00
鸡与蛋
la2la
2020-10-10 20:12:38 +08:00
软件更重要是的思路吧,感觉应该把 70%以上的时间放在构建思路上面,而不是实现代码。hadoop 第一版的代码也没有什么高端的操作,但是 map-reduce 的思想有几个能够提出来
jdhao
2020-10-10 20:17:09 +08:00
事后诸葛亮,如果有人能写,早写出来了,不用等到 Linus 2005 写出来。
ChristopherWu
2020-10-10 20:25:03 +08:00
git 实现本来就不难,设计做的比较好。我之前就写过了: https://v2ex.com/t/674356#reply3
ChristopherWu
2020-10-10 20:25:23 +08:00
@littlewing 术语叫自举。
masker
2020-10-10 20:45:07 +08:00
马后炮 ,事后诸葛亮挺多的
BenX
2020-10-10 21:36:48 +08:00
呵呵呵,Linux kernel 0.01 也就那样哇
shm7
2020-10-11 12:10:09 +08:00
@ChristopherWu 流皮。
liangch
2020-10-11 20:28:44 +08:00
最早的编译器怎么来的。就是这么来的。
zjsxwc
2020-10-12 08:34:22 +08:00
This is a stupid (but extremely fast) directory content manager. It
doesn't do a whole lot, but what it _does_ do is track directory
contents efficiently.

There are two object abstractions: the "object database", and the
"current directory cache".

The Object Database (SHA1_FILE_DIRECTORY)

The object database is literally just a content-addressable collection
of objects. All objects are named by their content, which is
approximated by the SHA1 hash of the object itself. Objects may refer
to other objects (by referencing their SHA1 hash), and so you can build
up a hierarchy of objects.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/713730

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX