我想不通。为什么这些行为不同:
(shell-command "git log")
(shell-command "git shortlog")
第一个按预期工作:返回 0 并将内容打印到 shell 输出缓冲区。第二个返回 0 但什么也不打印。这是为什么?
还
- 两者都可以完美地
git log
工作git shortlog
ansi-term
- 两者都
git log
发出git shortlog
警告,但仍在工作shell
man git-shortlog
If no revisions are passed on the command line and either standard input is not a terminal or there is no current branch, git shortlog will output a summary of the log read from standard input, without reference to the current repository.
You must explicitly provide reference to work in your case,
Use, git shortlog HEAD
instead.