V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
est
V2EX  ›  git

zig 写的 100kb 的 wasm 可以 http 读写任意 git 仓库

  •  
  •   est · Apr 25 · 1693 views

    https://blog.cloudflare.com/artifacts-git-for-agents-beta/

    entire git protocol engine is written in pure Zig (no libc), compiled to a ~100KB WASM binary.
    Support for both v1 and v2 of the git protocol.
    support capabilities including ls-refs, shallow clones (deepen, deepen-since, deepen-relative), and incremental fetch with have/want negotiation.

    有人知道这玩意开源不?不开源能扒出来别的地方用不?

    7 replies    2026-04-27 20:36:01 +08:00
    shyrock
        1
    shyrock  
       Apr 26 via iPhone
    这个能干啥
    kneo
        2
    kneo  
       Apr 26
    扒出来也只有只有核心的 git 功能,你让 AI 用 zig 写一个最简版本的 git 也许还更省事。
    rb6221
        3
    rb6221  
       Apr 26
    场景就是和 AI 对话的时候可以方便的持久化、版本控制你的对话内容,以及产出内容,用 git 的方式实现
    codehz
        4
    codehz  
       Apr 26
    git 那个协议也没复杂到需要 wasm 来做啊。。。感觉就是有锤子找钉子的问题
    est
        5
    est  
    OP
       Apr 27
    @codehz 还是挺复杂的。pack/unpack/sha1 这些轮子都得从 0 搓。

    首先 cf worker 没有 fs 模块,这就搞死一大堆人了。一搓一个不吱声。。。不是简单 libgit2 转一下能解决的。
    codehz
        6
    codehz  
       Apr 27 via Android
    @est 我说的是 https://isomorphic-git.org/ 这个
    est
        7
    est  
    OP
       Apr 27
    @codehz 用过。 https://blog.est.im/2026/stdout-08

    你可以试试通过它实现 shallow clones (deepen, deepen-since, deepen-relative) 。。。超蛋痛。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2499 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 09:09 · PVG 17:09 · LAX 02:09 · JFK 05:09
    ♥ Do have faith in what you're doing.