Emacs:为什么 shell 命令“git log"有效,但“git shortlog"不是吗? [英] Emacs: why shell-command "git log" works, but "git shortlog" doesn't?
问题描述
我想不通.为什么这些行为不同:
I can't figure this out. Why do these behave differently:
(shell-command "git log")
(shell-command "git shortlog")
第一个按预期工作:返回 0 并将内容打印到 shell 输出缓冲区.第二个返回 0 但不打印任何内容.这是为什么?
First one works as expected: returns 0 and prints stuff to shell output buffer. Second one returns 0 but prints nothing. Why is that?
还有
git log
和git shortlog
在ansi-term
中都能完美运行git log
和git shortlog
都给出警告,但在shell
中仍然有效
- both
git log
andgit shortlog
work perfectly inansi-term
- both
git log
andgit shortlog
give a warning but still work inshell
推荐答案
man git-shortlog
如果没有在命令行和任一标准上传递修订输入不是终端或没有当前分支,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,
使用,git shortlog HEAD
代替.
这篇关于Emacs:为什么 shell 命令“git log"有效,但“git shortlog"不是吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!