Skip to content

entire CLI commands break in the presence of negative refspecs in git #778

@cuyler-at-scribe

Description

@cuyler-at-scribe

What happened?

Basically, this error after any command (including enable, doctor, etc.):

Error: metadata check failed: failed to open repository: failed to open repository: failed to open repository: read config: malformed refspec, separators are wrong

According to Claude Code:

The problem is the negative refspec entries in your git config. These lines under [remote "origin"]:
[redacted]
Negative refspecs (the ^ prefix) were added in Git 2.29, but most third-party Git libraries (like go-git, which Entire.io almost certainly uses) don't support them. The "malformed refspec, separators are wrong" error is the classic go-git complaint when it encounters this syntax.

My git is set up this way to avoid fetching some specific references that end up ballooning fetches, so ideally this is fixed to simply support syntax that the current version of git supports.

Steps to reproduce

  1. Set up a .git/config file similar to this example:
  [core]
        repositoryformatversion = 1
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = true
  [remote "origin"]
        url = git@github.com:example/example.git
        promisor = true
        partialclonefilter = blob:none
        fetch = +refs/heads/*:refs/remotes/origin/*
        fetch = ^refs/heads/some-excluded-branch # <== The offending negation pattern!
        fetch = ^refs/heads/another-excluded-branch # <== (again)
  [branch "main"]
        remote = origin
        merge = refs/heads/main
  1. Try to do just about any entire command (so far, the only on I've seen not fail is entire disable).

Entire CLI version

Entire CLI 0.5.1 (d46fdc2)

OS and architecture

OS/Arch: darwin/arm64

Agent

N/A

Terminal

iTerm2, cmux

Logs / debug output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions