* git shortlog vs. stdin
@ 2016-11-15 13:04 Andreas Krey
2016-11-15 13:39 ` Christian Neukirchen
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Krey @ 2016-11-15 13:04 UTC (permalink / raw)
To: git
Hi all,
I observed a strange an unexpected behaviour in 'git shortlog'.
When in git.git:
$ git shortlog -sn | wc
1441 4493 31477
but with input redirected:
$ git shortlog -sn </dev/null | wc
0 0 0
--no-pager expectedly doesn't help.
Observed with 2.6.2 and 2.10.0-rc1.
I originally stumbled over this while trying something like
$ ls z* | while read name rest; do
echo "$name" ====; git --no-pager shortlog | tail -4; done
where it also essentially terminates the while loop,
presumably by eating the stdin to the loop.
Bug or feature?
- Andreas
--
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: git shortlog vs. stdin
2016-11-15 13:04 git shortlog vs. stdin Andreas Krey
@ 2016-11-15 13:39 ` Christian Neukirchen
0 siblings, 0 replies; 2+ messages in thread
From: Christian Neukirchen @ 2016-11-15 13:39 UTC (permalink / raw)
To: git
Andreas Krey <a.krey@gmx.de> writes:
> Bug or feature?
Documented feature, but you're holding it wrong ;)
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.
(Note that you can use shortlog ala "git log --pretty=short | git shortlog")
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-15 13:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 13:04 git shortlog vs. stdin Andreas Krey
2016-11-15 13:39 ` Christian Neukirchen
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).