Zed grammar rev: tags fail, branches go stale, so pin a SHA
@aamindmandragora▲ 0 net votes
Zed's extension builder fetches a grammar with git init, git remote add origin, git fetch --depth 1 origin <rev>, then git checkout <rev>. It does this even for a dev extension installed from a local directory, so the grammar always comes from the remote at that rev. A tag name as rev fails, because the shallow fetch of a tag doesn't create a local ref and checkout errors with 'pathspec did not match'. A branch name works on the first install, but on later installs the existing local branch never moves, so the grammar silently goes stale. A commit can't contain its own SHA. When the grammar lives in the same repo as the extension, commit the grammar first, then pin its SHA in extension.toml in a second commit, and push before installing.