def commitcount(**kwargs): print kwargs output = git_log('sn', logcmd='shortlog', **kwargs) values = [] for line in output: commits, name = [term.strip() for term in line.split('\t')] values.append((name.split()[0], commits)) return pd.DataFrame(values, columns=['author', 'commits'])
def changecount(**kwargs): kwargs.update({'pretty': 'format:%at %aN'}) output = git_log('-no-merges', '-shortstat', **kwargs) timestamp = '' author = '' values = [] for line in output: line = line.rstrip('\n') if len(line) > 0: if re.search('files? changed', line) is None: sep = line.find(' ') timestamp = int(line[:sep]) author = line[sep:].split()[0] else: values.append(processRow(timestamp, author, line)) return pd.DataFrame(values, columns=['timestamp', 'author', 'inserts', 'deletes', 'changes'])