INNER CODE UNIT · Python

load

MultiCraft/MultiCraft · util/gather_git_credits.py:19

def load(revs):
	points = defaultdict(int)
	p = subprocess.Popen(["git", "log", "--mailmap", "--pretty=format:%h %aN <%aE>", revs],
		stdout=subprocess.PIPE, universal_newlines=True)
	for line in p.stdout:
		hash, author = line.strip().split(" ", 1)
		n = 0

		p2 = subprocess.Popen(["git", "show", "--numstat", "--pretty=format:", hash],
			stdout=subprocess.PIPE, universal_newlines=True)
		for line in p2.stdout:
			added, deleted, filename = re.split(r"\s+", line.strip(), 2)
			if re.search(codefiles, filename) and added != "-":
				n += int(added)
		p2.wait()

		if n == 0:
			continue

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…