V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
jatsz
V2EX  ›  程序员

Git 第一版源代码

  •  
  •   jatsz · Oct 10, 2020 · 5362 views
    This topic created in 2036 days ago, the information mentioned may be changed or developed.

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

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

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