git/list[1] front-page[2] threads[3] people[4] search[5] about
 

"git foo_bar" prints two config errors

From
MMMikael Magnusson <mikachu@gmail.com>
Date
Oct 30, 2014, 13:00 UTC
Message-ID
<CAHYJk3Rf0rXd1=1+7n-PNABQ77MbKphr8T-nLgwdKNUW_iKo2Q@mail.gmail.com>

% git foo_bar error: invalid key: pager.foo_bar error: invalid key: alias.foo_bar git: 'foo_bar' is not a git command. See 'git --help'.

git.c calls alias_lookup() and check_pager_config() resulting in calls to git_config_parse_key() with the above keys. I looked at the code and it's not immediately obvious how to suppress the error in this particular case. You also get an error for the empty argument and anything that isn't (isalnum || '-') (I discovered the _ case by accidentally leaving out the 'grep' before searching for a function),

% git ''; git の error: key does not contain variable name: pager. error: key does not contain variable name: alias. git: '' is not a git command. See 'git --help'. error: invalid key: pager.の error: invalid key: alias.の git: 'の' is not a git command. See 'git --help'.

but, % ln -s /bin/tty ~/bin/git-の; ln -s /bin/tty ~/bin/git-foo_bar % git の error: invalid key: pager.の /dev/pts/51 % git foo_bar error: invalid key: pager.foo_bar /dev/pts/51

The command itself is accepted, so I think we shouldn't print the errors.
-- 
Mikael Magnusson
Message 1 of 1 in “"git foo_bar" prints two config errors”
  1. Mikael MagnussonOct 30, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.