"git foo_bar" prints two config errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



% 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]