entireio / entireio/cli

`entire` CLI commands break in the presence of negative refspecs in `git`

Open
#778 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
5.1k
Forks
475
Avg merge
1d 11h
Merged PRs (30d)
178

Description

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 (d46fdc24)

OS and architecture

OS/Arch: darwin/arm64

Agent

N/A

Terminal

iTerm2, cmux

Logs / debug output

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the provided .git/config and trace the repository-opening path that reports “malformed refspec, separators are wrong.” Add regression coverage for negative fetch refspecs and verify that the affected Entire commands, including enable and doctor, no longer fail while disable remains unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.