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
$ b $中可以完美地工作b -
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屋!