1

On macOS, the tool ghi (GitHub Issues on the command line) adds the following to ~/.gitconfig:

[ghi]
    token = !security find-internet-password -a username -s github.com -l 'ghi token' -w

It is my understanding that by starting with a !, it means that is a shell command. And indeed it is, as executing it returns the correct authentication token (stored in the macOS Keychain). But running git config --get ghi.token returns the command itself (with !), instead of its result, which was what I was expecting because it seems that ghi would use that to retrieve the key.

What is the git command, if any, to return the result of the command, instead of the command itself?

1 Answer 1

2

There is no such command; ghi reads the configuration value, strips the '!' and executes the result:

    value = ENV[var] || `git config #{flags} #{key}`
    value = `#{value[1..-1]}` if value.start_with? '!'

see ghi repository

git uses ! at some places the mark configuration values as programs instead of plain value; but there is not automatic evaluation behind.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.