V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jatsz
V2EX  ›  程序员

Git 第一版源代码

  •  
  •   jatsz · 2020-10-10 17:09:24 +08:00 · 4345 次点击
    这是一个创建于 1266 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    16 条回复    2020-10-12 08:34:22 +08:00
    Loserzhu
        1
    Loserzhu  
       2020-10-10 17:28:11 +08:00
    一种错觉,最近好多文章都在写 git 第一版源码。
    第一个是看的阿里技术发的文,然后就铺天盖地的 git 第一版。
    tao1991123
        2
    tao1991123  
       2020-10-10 17:31:11 +08:00
    git 的第一行代码 怎么会使用 git 进行管理呢?
    luassuns
        3
    luassuns  
       2020-10-10 18:07:57 +08:00 via Android
    @tao1991123 #2 写完第一版后,再一把 commit 就行了呀
    hutusi
        4
    hutusi  
       2020-10-10 18:55:59 +08:00
    @Loserzhu 我也写了一篇:-) 阿里的文章我也看了,但实际上我写的更早一个月,只不过先发在了公司内网里 😪
    codehz
        5
    codehz  
       2020-10-10 19:07:45 +08:00
    然后这玩意被刷了几百条评论
    littlewing
        6
    littlewing  
       2020-10-10 19:19:40 +08:00 via iPhone
    @tao1991123 你这个问题类似于怎么用 go 写 go
    qwerthhusn
        7
    qwerthhusn  
       2020-10-10 19:53:28 +08:00
    鸡与蛋
    la2la
        8
    la2la  
       2020-10-10 20:12:38 +08:00   ❤️ 1
    软件更重要是的思路吧,感觉应该把 70%以上的时间放在构建思路上面,而不是实现代码。hadoop 第一版的代码也没有什么高端的操作,但是 map-reduce 的思想有几个能够提出来
    jdhao
        9
    jdhao  
       2020-10-10 20:17:09 +08:00
    事后诸葛亮,如果有人能写,早写出来了,不用等到 Linus 2005 写出来。
    ChristopherWu
        10
    ChristopherWu  
       2020-10-10 20:25:03 +08:00
    git 实现本来就不难,设计做的比较好。我之前就写过了: https://v2ex.com/t/674356#reply3
    ChristopherWu
        11
    ChristopherWu  
       2020-10-10 20:25:23 +08:00
    @littlewing 术语叫自举。
    masker
        12
    masker  
       2020-10-10 20:45:07 +08:00 via Android
    马后炮 ,事后诸葛亮挺多的
    BenX
        13
    BenX  
       2020-10-10 21:36:48 +08:00
    呵呵呵,Linux kernel 0.01 也就那样哇
    shm7
        14
    shm7  
       2020-10-11 12:10:09 +08:00
    @ChristopherWu 流皮。
    liangch
        15
    liangch  
       2020-10-11 20:28:44 +08:00
    最早的编译器怎么来的。就是这么来的。
    zjsxwc
        16
    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.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2939 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:09 · PVG 19:09 · LAX 04:09 · JFK 07:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.