Browse Source

Fix running gitstats with a non-tty stdin.

The following command used to fail because git shortlog has some witty magic to
decide the behaviour based on whether stdin is a terminal:

./gitstats /repo /dst < /dev/null

effectively causing a lot of shell scripts calling gitstats to fail with
"Division by zero" in author statistics.

Thanks-to: Bertrand Jacquin <beber@meleeweb.net>
Thanks-to: Sylvain Rabot <sylvain@abstraction.fr>
Heikki Hokkanen 15 years ago
parent
commit
5e11dfbe32
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      gitstats

+ 1
- 1
gitstats View File

59
 	exectime_external += (end - start)
59
 	exectime_external += (end - start)
60
 	return output.rstrip('\n')
60
 	return output.rstrip('\n')
61
 
61
 
62
-def getcommitrange(defaultrange = '', end_only = False):
62
+def getcommitrange(defaultrange = 'HEAD', end_only = False):
63
 	if len(conf['commit_end']) > 0:
63
 	if len(conf['commit_end']) > 0:
64
 		if end_only or len(conf['commit_begin']) == 0:
64
 		if end_only or len(conf['commit_begin']) == 0:
65
 			return conf['commit_end']
65
 			return conf['commit_end']