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 bug rewrites .git/config and loses comments #1022

Open
philpennock opened this issue Feb 21, 2023 · 3 comments
Open

git bug rewrites .git/config and loses comments #1022

philpennock opened this issue Feb 21, 2023 · 3 comments

Comments

@philpennock
Copy link

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
@MichaelMure
Copy link
Owner

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?

@MichaelMure
Copy link
Owner

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

@MichaelMure
Copy link
Owner

MichaelMure commented Mar 4, 2023

https://github.com/gravwell/gcfg also seems maintained.

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