Git 第一版源代码 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
不要在回答技术问题时复制粘贴 AI 生成的内容
jatsz
V2EX    程序员

Git 第一版源代码

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

    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 流皮。
        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     Solana     910 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 27ms UTC 19:48 PVG 03:48 LAX 12:48 JFK 15:48
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86