MichaelMure / git-bug

Distributed, offline-first bug tracker embedded in git, with bridges

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git bug rewrites .git/config and loses comments

philpennock opened this issue · comments

The file .git/config can be added to and removed from though automation, but does support comments.

Using git bug in a repo stomps on the file, rewriting it and losing comments, blank lines, etc.

Observed behavior

  1. Add a comment to a repo's .git/config
  2. Run git bug bridge pull
  3. Look at .git/config and see the comment has gone

Desired behavior:

  1. comments preserved, everything outside of the git-bug area preserved
  2. git bug doesn't edit the config at all unless it needs to, rather than on every operation

Affirmed behavior still present in current HEAD:

git-bug version: v0.8.0-dev-55e4046b4b

Oof, that's quite unfortunate. That's very likely a problem in https://github.com/go-git/gcfg.

Unfortunately again, this project (part of go-git) is quite slow to progress. I have two PRs open there for a while.

We could switch to another library to edit the git config, but I don't know any. Or maintain a fork, but that's quickly annoying. Would you be able to fix that problem in gcfg?

Actually, maybe https://github.com/please-build/gcfg could do, it kinda seems like there is proper support for comments.