Skip to content
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

git prompt broken with some (multiline?) git config #1766

Closed
desbma opened this issue Feb 12, 2022 · 9 comments
Closed

git prompt broken with some (multiline?) git config #1766

desbma opened this issue Feb 12, 2022 · 9 comments

Comments

@desbma
Copy link

desbma commented Feb 12, 2022

When I add this in my git config (this is to configure the delta pager output, see chtenb/delta@603b807 for context):

[delta]
    minus-style = syntax "#330f0f"
    minus-emph-style = syntax "#4f1917"
    plus-style = syntax "#0e2f19"
    plus-emph-style = syntax "#174525"
    map-styles = \
       bold purple => syntax "#330f29", \
       bold blue => syntax "#271344", \
       bold cyan => syntax "#0d3531", \
       bold yellow => syntax "#222f14"
    zero-style = syntax
    whitespace-error-style = "#aaaaaa"

The git prompt does not show anymore. If I run killall gitstatusd it shows again, but will not on the next terminal.
If I has to guess I'd say gitstatusd fails to parse the multiline configuration entry.
Of course the git configuration is perfectly valid and git works as expected.

Thanks

@desbma
Copy link
Author

desbma commented Feb 12, 2022

If that helps, when I manually send a command to gitstatusd, it outputs this error:

ERROR src/repo_cache.cc:66] git_repository_open_ext: "[removed].git/": failed to parse config file: invalid configuration key (in /home/desbma/.config/git/config:49)

@romkatv
Copy link
Owner

romkatv commented Feb 12, 2022

This is probably an issue with libgit2. Can you check whether lg2 status works? You'll need to compile lg2 from sources. It's in examples, I think.

@desbma
Copy link
Author

desbma commented Feb 12, 2022

lg2 status works (libgit2 commit 416f7cb34762a75ae2ca14959caa59d94bc14919)

EDIT: Also works with libgit2 on tag v1.3.0

@desbma
Copy link
Author

desbma commented Feb 12, 2022

I'm using the Arch Linux package, which is using your libgit2 fork on the tag-d6c37a38587c9af2a9e63449fc8bf951dca0e854 tag, see https://github.com/archlinux/svntogit-community/blob/packages/zsh-theme-powerlevel10k/trunk/PKGBUILD#L9.
When building libgit2 on this commit, lg2 fails with failed to parse config file: invalid configuration key (in /home/desbma/.config/git/config:49

@romkatv
Copy link
Owner

romkatv commented Feb 13, 2022

Thanks for the details. So either there was a bug in libgit2 and it's got fixed (in which case I'll need to upgrade libgit2 dependency of gitstatusd) or I introduced a bug in my fork of libgit2 (in which case I would need to fix it).

I'm afraid I don't currently have time to do either for these. Maybe at some point in the future.

@desbma
Copy link
Author

desbma commented Feb 13, 2022

No worries I understand the lack of time.

The issue was not introduced by your fork, and with git bisect I found it was fixed upstream by this commit: 574c590f3095535e55e8f99b7f571ede28c8c211.

So just updating libgit2 should be enough to fix it.

@romkatv
Copy link
Owner

romkatv commented Feb 14, 2022

Thanks for doing all the work here. I've cherry-picked the commit you've identified and released a new version of gitstatusd. Please update powerlevel10k and let me know whether the issue is resolved.

@desbma
Copy link
Author

desbma commented Feb 14, 2022

It's fixed, thanks.

@desbma desbma closed this as completed Feb 14, 2022
@romkatv
Copy link
Owner

romkatv commented Feb 14, 2022

Thanks for verifying.

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

No branches or pull requests

2 participants