git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git shortlog vs. stdin

From
Andreas Krey <a.krey@gmx.de>
Date
Nov 15, 2016, 13:04 UTC
Message-ID
<20161115130418.GA28847@inner.h.apk.li>
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
Next: Christian Neukirchen
Message 1 of 2 in “git shortlog vs. stdin”
  1. Andreas KreyNov 15, 2016
  2. Christian NeukirchenNov 15, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.