#include "shortlog.h"
static const char shortlog_usage[] =
-"git-shortlog [-n] [-s] [-e] [<commit-id>... ]";
+"git-shortlog [-n] [-s] [-e] [-w] [<commit-id>... ]";
static int compare_by_number(const void *a1, const void *a2)
{
{
struct shortlog log;
struct rev_info rev;
+ int nongit;
+ prefix = setup_git_directory_gently(&nongit);
shortlog_init(&log);
/* since -n is a shadowed rev argument, parse our args first */
die ("unrecognized argument: %s", argv[1]);
/* assume HEAD if from a tty */
- if (!rev.pending.nr && isatty(0))
+ if (!nongit && !rev.pending.nr && isatty(0))
add_head_to_pending(&rev);
if (rev.pending.nr == 0) {
read_from_stdin(&log);