guyzmo / git-repo

Git-Repo: CLI utility to manage git services from your workspace
https://webchat.freenode.net/?channels=#git-repo
Other
842 stars 85 forks source link

config wizard does not work if ~/.config/git/config contains include statements #153

Open dmerejkowsky opened 7 years ago

dmerejkowsky commented 7 years ago

Steps to reproduce:

[include]
path = /path/to/1
path = /path/to/2

Run git-repo config, do the oauth dance.

Nothing is stored.

PS: I think this is a bug in the code that reads and writes git config. If I were you, I'll just run git config --get foo.bar and git config --global foo.bar 42 instead of using a re-implementation of git config parsing in Python.

guyzmo commented 7 years ago

as a note: only the config wizard does not work, the tool does work! At the end of the configuration section, it is explained how you can extract your git-repo configuration into another file.

For those who like to keep all dotfiles in a git repository, it'd be horrendous to store tokens that offer access to your social accounts in a repository… And I'm not even talking about those who want to share your dotfiles. But don't worry, once it's all configured, you can fire up your favorite editor and move all the [gitrepo …] sections into a new file, like ~/.gitconfig-repos.

Your can run the following command to do this automagically:

python -m git_repo.extract_config

if you want to use another path, you can change the defaults:

python -m git_repo.extract_config ~/.gitconfig-repos ~/.gitconfig
dmerejkowsky commented 7 years ago

you can extract your git-repo configuration into another file.

ahah! Nice.

Feel free to close, then

guyzmo commented 7 years ago

well, the issue is still painful and there's a tracking issue on gitpython. I guess I could add take the reference to the config file that needs to be modified?

guyzmo commented 7 years ago

though that comment was for whoever popped on the #git-repo channel asking on how he can use a versioned git config, citing this issue... 😉

alex-chew commented 7 years ago

@guyzmo Ah, that was me; thanks for the quick response! Configuring with git repo config and then using the extract_config script worked well. I had been trying to use something like git repo config --config=~/.gitconfig-repos but was getting errors mentioning a missing .lock file, which I would guess is on the GitPython end.