Emacs:为什么 shell 命令“git log"有效,但“git shortlog"不是吗? [英] Emacs: why shell-command "git log" works, but "git shortlog" doesn't?

查看:20
本文介绍了Emacs:为什么 shell 命令“git log"有效,但“git shortlog"不是吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想不通.为什么这些行为不同:

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?

还有

  1. git loggit shortlogansi-term
  2. 中都能完美运行
  3. git loggit shortlog 都给出警告,但在 shell
  4. 中仍然有效
  1. both git log and git shortlog work perfectly in ansi-term
  2. both git log and git shortlog give a warning but still work in shell

推荐答案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆