我想不通。为什么这些行为不同:
(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.
您必须在您的案例中明确提供工作引用,
改用 git shortlog HEAD
。
关于git - Emacs:为什么 shell 命令 "git log"有效,但 "git shortlog"无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19741957/