Browse Source

Minor optimization for line counting.

- git-rev-list: use %T instead of %H
- git-ls-tree: added --name-only
Heikki Hokkanen 18 years ago
parent
commit
1517256900
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      gitstats

+ 1
- 1
gitstats View File

228
 		# TODO Optimize this, it's the worst bottleneck
228
 		# TODO Optimize this, it's the worst bottleneck
229
 		# outputs "<stamp> <files>" for each revision
229
 		# outputs "<stamp> <files>" for each revision
230
 		self.files_by_stamp = {} # stamp -> files
230
 		self.files_by_stamp = {} # stamp -> files
231
-		lines = getoutput('git-rev-list --pretty=format:"%at %H" HEAD |grep -v ^commit |while read line; do set $line; echo "$1 $(git-ls-tree -r "$2" |wc -l)"; done').split('\n')
231
+		lines = getoutput('git-rev-list --pretty=format:"%at %T" HEAD |grep -v ^commit |while read line; do set $line; echo "$1 $(git-ls-tree -r --name-only "$2" |wc -l)"; done').split('\n')
232
 		self.total_commits = len(lines)
232
 		self.total_commits = len(lines)
233
 		for line in lines:
233
 		for line in lines:
234
 			parts = line.split(' ')
234
 			parts = line.split(' ')