Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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")

First one works as expected: returns 0 and prints stuff to shell output buffer. Second one returns 0 but prints nothing. Why is that?

Also

  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
like image 869
abo-abo Avatar asked Nov 02 '13 12:11

abo-abo


People also ask

What is git Shortlog?

The git shortlog command is used to summarize the output of git log . It will take many of the same options that the git log command will but instead of listing out all of the commits it will present a summary of the commits grouped by author.

What does git log follow do?

Use --follow option in git log to view a file's history This lists out the commits of both the files. Still, the first commit of the TS file would be a single creation commit, and the last commit of the JS file would be a single deletion one.

How do I get git logs?

The command for that would be git log –oneline -n where n represents the number up to which commit you to want to see the logs.


1 Answers

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.

You must explicitly provide reference to work in your case,

Use, git shortlog HEAD instead.

like image 137
Sazzad Hissain Khan Avatar answered Oct 06 '22 23:10

Sazzad Hissain Khan