Emacs:为什么shell命令"git log"有效,但"git shortlog"不行?

abo*_*abo 9 git emacs shell elisp

我无法弄清楚这一点.为什么这些行为有所不同:

(shell-command "git log")
(shell-command "git shortlog")
Run Code Online (Sandbox Code Playgroud)

第一个按预期工作:返回0并将东西打印到shell输出缓冲区.第二个返回0但不打印任何内容.这是为什么?

  1. 双方git loggit shortlog在完美地工作ansi-term
  2. 两者git loggit shortlog发出警告但仍然有效shell

Saz*_*han 6

man git-shortlog

如果没有在命令行上传递任何修订,并且标准输入不是终端或没有当前分支,则git shortlog将输出从标准输入读取的日志的摘要,而不会引用当前存储库。

您必须明确提供参考,以适合您的情况,

使用git shortlog HEAD代替。