From 151725690013f5e7061b72da7febe9fa7a5e964c Mon Sep 17 00:00:00 2001 From: Heikki Hokkanen Date: Thu, 13 Sep 2007 19:42:55 +0300 Subject: [PATCH] Minor optimization for line counting. - git-rev-list: use %T instead of %H - git-ls-tree: added --name-only --- gitstats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitstats b/gitstats index a2fc26f..8869500 100755 --- a/gitstats +++ b/gitstats @@ -228,7 +228,7 @@ class GitDataCollector(DataCollector): # TODO Optimize this, it's the worst bottleneck # outputs " " for each revision self.files_by_stamp = {} # stamp -> files - 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') + 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') self.total_commits = len(lines) for line in lines: parts = line.split(' ') -- 2.11.4.GIT