{"thread":{"id":"44486","subject":"git shortlog vs. stdin","startedAt":"2016-11-15T13:11:13Z","lastAt":"2016-11-15T13:41:08Z","messageCount":2,"participants":["Andreas Krey","Christian Neukirchen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"305946","messageId":"20161115130418.GA28847@inner.h.apk.li","threadId":"44486","inReplyTo":null,"subject":"git shortlog vs. stdin","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2016-11-15T13:04:18Z","receivedAt":"2016-11-15T13:11:13Z","isPatch":false,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"Hi all,\n\nI observed a strange an unexpected behaviour in 'git shortlog'.\n\nWhen in git.git:\n\n$ git shortlog -sn | wc\n   1441    4493   31477\n\nbut with input redirected:\n\n$ git shortlog -sn </dev/null | wc\n      0       0       0\n\n--no-pager expectedly doesn't help.\n\nObserved with 2.6.2 and 2.10.0-rc1.\n\nI originally stumbled over this while trying something like\n\n$ ls z* | while read name rest; do\n  echo \"$name\" ====; git --no-pager shortlog | tail -4; done\n\nwhere it also essentially terminates the while loop,\npresumably by eating the stdin to the loop.\n\nBug or feature?\n\n- Andreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"},{"id":"305947","messageId":"877f84dfps.fsf@gmail.com","threadId":"44486","inReplyTo":"20161115130418.GA28847@inner.h.apk.li","subject":"Re: git shortlog vs. stdin","fromName":"Christian Neukirchen","fromEmail":"chneukirchen@gmail.com","sentAt":"2016-11-15T13:39:59Z","receivedAt":"2016-11-15T13:41:08Z","isPatch":false,"sender":{"key":"chneukirchen@gmail.com","avatar":"https://avatars.githubusercontent.com/u/139?v=4"},"body":"Andreas Krey <a.krey@gmx.de> writes:\n\n> Bug or feature?\n\nDocumented feature, but you're holding it wrong ;)\n\n       If no revisions are passed on the command line and either standard\n       input is not a terminal or there is no current branch, git shortlog\n       will output a summary of the log read from standard input, without\n       reference to the current repository.\n\n(Note that you can use shortlog ala \"git log --pretty=short | git shortlog\")\n\n-- \nChristian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org\n\n"}]}