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
- Add a comment to a repo's
.git/config
- Run
git bug bridge pull
- Look at
.git/config
and see the comment has gone
Desired behavior:
- comments preserved, everything outside of the git-bug area preserved
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.
https://github.com/gravwell/gcfg also seems maintained.