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

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

Open
dmerejkowsky opened this issue May 7, 2017 · 5 comments

Comments

@dmerejkowsky
Copy link
Contributor

Steps to reproduce:

  • Make sure ~/.git does not exist
  • Create ~/.config/git/config` with a least two includes, like so:
[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 guyzmo changed the title config wizard does not work in ~/.config/git/config contains include statements config wizard does not work if ~/.config/git/config contains include statements Nov 20, 2017
@guyzmo
Copy link
Owner

guyzmo commented Nov 24, 2017

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
Copy link
Contributor Author

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

ahah! Nice.

Feel free to close, then

@guyzmo
Copy link
Owner

guyzmo commented Nov 24, 2017

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

guyzmo commented Nov 24, 2017

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
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants