Commit 537a245e authored by Gustavo Padovan's avatar Gustavo Padovan

backlog-tree: small fixes

parent 00c73816
......@@ -32,9 +32,12 @@ git log --pretty='format:%h,"%s",,' <revision range> | <path to>/contribution-st
Options:
* `-s, --summary`: show only a summary with the numbers for each person, but no details
* `-o, --output`: output result to a file instead of stdout
* `--html`: output as html with link to commits
* `-h, --help`: show help
* `-s, --summary`: sort output according to the number of commits instead of alphabetic order
* `-n, --numbered`: suppress commit description and provide a commit count summary only
* `-e, --email`: show the email address of each contributor
* `-o FILE, --output FILE`: output result to a file instead of stdout
* `--html FILE`: output as html with link to commits
### Generating HTML tree view
......
......@@ -3,11 +3,13 @@ import pygit2 as git
import sys
import csv
import json
import os
from datetime import datetime
from jinja2 import Environment, FileSystemLoader
import jinja2
GIT_TREE="/home/gfpadovan/p/linux"
BASE_URL="https://chromium.googlesource.com/chromiumos/third_party/kernel/+/"
#BASE_URL="https://chromium.googlesource.com/chromiumos/third_party/kernel/+/"
BASE_URL="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id="
def classify_commit(fs_dict, commit):
diff = repo.diff(commit[0], commit[0] + "^")
......@@ -18,7 +20,7 @@ def classify_commit(fs_dict, commit):
if entry == path_l[-1]:
if entry not in partial_dict.keys():
partial_dict[entry] = [[], 0]
partial_dict[entry][0].append(commit)
(partial_dict[entry][0]).append(commit)
if entry not in partial_dict.keys():
partial_dict[entry] = [{}, 0]
......@@ -27,14 +29,13 @@ def classify_commit(fs_dict, commit):
partial_dict = partial_dict[entry][0]
def generate_html(repo, fs_dict, title, cmd, head):
file_loader = FileSystemLoader('templates')
env = Environment(loader=file_loader)
env = jinja2.Environment(loader=jinja2.FileSystemLoader('{}/templates'.format(sys.path[0])))
template = env.get_template('backlog-tree.html.j2')
return template.render(data=fs_dict, baseurl=BASE_URL, title=title, cmdline=cmd, head=head, now=datetime.now())
if __name__ == "__main__":
repo = git.Repository(GIT_TREE)
repo = git.Repository(os.getcwd())
name = sys.argv[2]
cmdline = sys.argv[3]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment