gpt4 book ai didi

git - Emacs:为什么 shell 命令 "git log"有效,但 "git shortlog"无效?

转载 作者:太空狗 更新时间:2023-10-29 12:47:38 24 4
gpt4 key购买 nike

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

(shell-command "git log")
(shell-command "git shortlog")

第一个按预期工作:返回 0 并将内容打印到 shell 输出缓冲区。第二个返回 0 但不打印任何内容。这是为什么?

还有

  1. git loggit shortlog 都可以在 ansi-term 中完美运行
  2. git loggit 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com