我发现自己经常打字git st .(st已经别名的地方status)来获取当前目录文件的状态.
我经常错误地认为那git st.当然不被认可.
我希望能够使用别名,st.但似乎不能.如果我添加st. = status .到我的.gitconfig别名,我fatal: bad config file在git调用上会出错.
是否可以创建一个包含句点的别名?
没有; 如果你看config.c,它必须是字母数字.
/*
* Validate the key and while at it, lower case it for matching.
*/
*store_key = xmalloc(strlen(key) + 1);
dot = 0;
for (i = 0; key[i]; i++) {
unsigned char c = key[i];
if (c == '.')
dot = 1;
/* Leave the extended basename untouched.. */
if (!dot || i > baselen) {
if (!iskeychar(c) ||
(i == baselen + 1 && !isalpha(c))) {
error("invalid key: %s", key);
goto out_free_ret_1;
}
c = tolower(c);
} else if (c == '\n') {
error("invalid key (newline): %s", key);
goto out_free_ret_1;
}
(*store_key)[i] = c;
}
(*store_key)[i] = 0;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
369 次 |
| 最近记录: |