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

gh moves ~/.config/gh to $PWD/~/.config/gh #5897

Closed
IanEdington opened this issue Jul 7, 2022 · 3 comments
Closed

gh moves ~/.config/gh to $PWD/~/.config/gh #5897

IanEdington opened this issue Jul 7, 2022 · 3 comments
Labels
bug Something isn't working needs-triage needs to be reviewed

Comments

@IanEdington
Copy link

IanEdington commented Jul 7, 2022

Describe the bug

When gh is run it moves .config/gh into the current directory under a directory named ~.

Steps to reproduce the behaviour

  1. have ~/.config symlinked to another folder containing a gh/config
  2. run gh repo clone in other directory (haven't checked if its caused by other commands)

Expected vs actual behaviour

gh should use the symlinked ~/.config folder and not move it to a local folder

gh moves ~/.config/gh to $PWD/~/.config/gh

Logs

How my .config folder is organized

 ❯ ls ~/.config/
d1/  d2/  d3@  gh/

the cause

pwd
/Users/IanEdington/repos

 ❯ gh <Tab>
# any `gh` command, even just triggering autocomplete

the result

 ❯ ls ~/.config/
d1/  d2/  d3@
# gh directory is missing

 ❯ ls
icloud-photo-sync/ ~/
# new '~' directory created where ever the gh command is executed

 ❯ ls "$PWD/~/.config/gh"
config.yml  hosts.yml
# new '~' directory contains only the `gh` folder and sub-files

gh files

config.yml

# What protocol to use when performing git operations. Supported values: ssh, https
git_protocol: ssh
# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
editor: !!null vim
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
prompt: enabled
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
pager:
# Aliases allow you to create nicknames for gh commands
aliases:
    co: pr checkout

hosts.yml

github.com:
    git_protocol: ssh

debugging notes

  • latest version available through homebrew (2.13.0)
  • happens in both bash and zsh
@IanEdington IanEdington added the bug Something isn't working label Jul 7, 2022
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Jul 7, 2022
@samcoe
Copy link
Contributor

samcoe commented Jul 11, 2022

@IanEdington Hmmm that is odd, I was unable to reproduce this locally. I do suspect that this is a bug with the code that was meant to automatically migrate legacy config files into our current config file format. Fortunately, #5771 removes that functionality as there shouldn't be any more users with legacy config files. I am going to close this issue for now in anticipation that the next release will fix this issue. @IanEdington if it does not, please feel free to comment here and we will investigate further 👍

@samcoe samcoe closed this as completed Jul 11, 2022
@IanEdington
Copy link
Author

I can confirm that the newest version fixes this issue

@IanEdington
Copy link
Author

For anyone coming across this issue in the future.

#5771 fixed the moving but gh was still not able to read the config at ~/.config/gh/config.yml

setting a config file was also

The issue was that I had added an incorrect config path in my environment:

export XDG_CONFIG_HOME="~/.config"

The ~ was being interpreted as a literal '' so the config directory ended up being "$PWD//.config/gh"

export XDG_CONFIG_HOME="$HOME/.config"

solved the issue for me

IanEdington added a commit to IanEdington/dotfiles that referenced this issue Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

3 participants