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
git log
and git shortlog
work perfectly in ansi-term
git log
and git shortlog
give a warning but still work in shell
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With