foriequal0 / git-trim

Automatically trims your branches whose tracking remote refs are merged or stray
MIT License
485 stars 14 forks source link

Valid .gitconfig is rejected and prevent usage of the tool #185

Closed CBenoit closed 2 years ago

CBenoit commented 2 years ago

Check your version before submitting the bug

> git trim --version
git-trim 0.4.2

Describe the bug

Valid .gitconfig is rejected.

To Reproduce

  1. Put this in your .gitconfig (source: delta)
    [delta "zebra-dark"]
        map-styles = \
           bold purple => syntax "#380233", \
           bold blue => syntax "#1b0738", \
           bold cyan => syntax "#00302b", \
           bold yellow => syntax "#222f14"
  2. Run git trim

Expected behavior

Just works :tm:

Actual behaviour

Error: failed to parse config file: invalid configuration key (in /home/[redacted]/.gitconfig:5); class=Config (7)

Additional context and logs & dumps if necessary

> uname -srm
Linux 5.16.15-1-default x86_64

Linux distribution: openSUSE Tumbleweed.

CBenoit commented 2 years ago

I understand the issue is due to git2 dependency being outdated. cargo v1.47.0 has the same issue, but not later versions using an updated git2 version. Maybe consider publishing an updated git trim release?

CBenoit commented 2 years ago

Addressed by commits in #186 that are cherry-picked in master.