Skip to content

"entry is not unique due to being a multivar" #2700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
amiantos opened this issue Apr 27, 2025 · 3 comments
Open

"entry is not unique due to being a multivar" #2700

amiantos opened this issue Apr 27, 2025 · 3 comments

Comments

@amiantos
Copy link

amiantos commented Apr 27, 2025

I've recently started getting this error often when I am trying to delete local branches within GitUp, it does not seem to happen to every branch, just some branches. It does not appear to be dependent on a specific git repo, it happens in all my git repos. It didn't start happening to me until one or two updates ago. I can successfully delete any branches this happens to via git CLI, the error seems to be GitUp specific. A quick google suggests it may be coming from libgit2...?

Image

@Cykelero
Copy link
Contributor

That error seems to occur when reading Git config variables that are structured in an unexpected way, specifically. Could you share (the non-sensitive parts of) your Git config?

The next time GitUp shows this error, open the repo in a Terminal and run:

git config --list --show-origin

@amiantos
Copy link
Author

That error seems to occur when reading Git config variables that are structured in an unexpected way, specifically. Could you share (the non-sensitive parts of) your Git config?

The next time GitUp shows this error, open the repo in a Terminal and run:

git config --list --show-origin
file:/Library/Developer/CommandLineTools/usr/share/git-core/gitconfig   credential.helper=osxkeychain
file:/Library/Developer/CommandLineTools/usr/share/git-core/gitconfig   init.defaultbranch=main
file:/Users/amiantos/.gitconfig user.name=amiantos
file:/Users/amiantos/.gitconfig [email protected]
file:.git/config        core.repositoryformatversion=0
file:.git/config        core.filemode=true
file:.git/config        core.bare=false
file:.git/config        core.logallrefupdates=true
file:.git/config        core.ignorecase=true
file:.git/config        core.precomposeunicode=true
file:.git/config        [email protected]:amiantos/postalgic.git
file:.git/config        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config        branch.main.remote=origin
file:.git/config        branch.main.merge=refs/heads/main
file:.git/config        branch.main.vscode-merge-base=origin/main
file:.git/config        branch.s3-publish.vscode-merge-base=origin/main
file:.git/config        branch.s3-publish.vscode-merge-base=origin/main
file:.git/config        branch.s3-publish.github-pr-owner-number=amiantos#postalgic#4

Similarly in another repo where I get the same issue, this is the config for two branches that displays the same error.

file:.git/config        branch.fix-soft-upgrade.vscode-merge-base=origin/master
file:.git/config        branch.fix-soft-upgrade.vscode-merge-base=origin/master
file:.git/config        branch.fix-soft-upgrade.remote=origin
file:.git/config        branch.fix-soft-upgrade.merge=refs/heads/fix-soft-upgrade

file:.git/config        branch.fix-canceled-sub-editor-change.vscode-merge-base=origin/master
file:.git/config        branch.fix-canceled-sub-editor-change.vscode-merge-base=origin/master
file:.git/config        branch.fix-canceled-sub-editor-change.remote=origin
file:.git/config        branch.fix-canceled-sub-editor-change.merge=refs/heads/fix-canceled-sub-editor-change
file:.git/config        branch.fix-canceled-sub-editor-change.github-pr-owner-number=[removed]

Looks to me like the similarity is that there are multiple of the vscode-merge-base entry in all of them... the branches I can delete successfully do not have two entries.

Let me know if there is anything else I can do to help debug.

@Cykelero
Copy link
Contributor

Cykelero commented May 4, 2025

Thanks for the details! I was able to reproduce locally by adding duplicate config options, like in your setup.

This does look like this is a libgit2 issue: GitUp calls git_branch_delete, which tries to delete config related to the branch, and that fails for this variable because it has multiple values.

Of note, #2683 kind of fixes the issue: with that PR, deleting the branch still fails (now with a could not find key 'XXX' to delete error), but does remove the config options, so it succeeds the next time you attempt it.

We should open an issue with libgit2, since that's where the actual bug seems to live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants