Emacs: why does the git log shell command work, but the git shortlog does not work?

I can’t figure it out. Why do they behave differently:

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

The first works as expected: returns 0 and prints the material to the shell output buffer. The second returns 0, but does not print anything. Why is this?

Besides

  • both git log and git shortlog work fine in ansi-term
  • both git log and git shortlog give warning, but still work in shell
+7
git shell emacs elisp
source share
1 answer

man git-shortlog

If no revisions are passed on the command line and neither standard input is a terminal or the current branch is present, git shortlog displays a summary of the log read from standard input without a link to the current repository.

You must explicitly indicate the link to the work in your case,

Use git shortlog HEAD instead of git shortlog HEAD .

+2
source share

All Articles