git bug rewrites .git/config and loses comments

Labels: lifecycle/rotten

Timeline

Phil Pennock (philpennock) opened

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

Michael Muré (MichaelMure) commented

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?

github-actions (github-actions) commented

This bot triages untriaged issues and PRs according to the following rules:

  • After 90 days of inactivity, the lifecycle/stale label is applied
  • After 30 days of inactivity since lifecycle/stale was applied, the issue is closed

To remove the stale status, you can:

  • Remove the lifecycle/stale label
  • Comment on this issue

github-actions (github-actions) added label lifecycle/stale

github-actions (github-actions) commented

This bot triages issues in order to help the maintainers identify what needs attention, according to the following lifecycle rules:

  • After 90 days of inactivity, lifecycle/stale is applied
  • After 90 days of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied

This bot will not automatically close stale issues.

To remove the stale status, you can:

  • Remove the stale label from this issue
  • Comment on this issue
  • Close this issue
  • Offer to help out with triaging

To avoid automatic lifecycle management of this issue, add lifecycle/frozen.

github-actions (github-actions) added label lifecycle/rotten

github-actions (github-actions) removed label lifecycle/stale

sudoforge removed label lifecycle/dormant