Skip to content
Snippets Groups Projects
Commit 8202406f authored by Sebastien Helleu's avatar Sebastien Helleu
Browse files

Make options title/repository optional, add option -m/--max, major code...

Make options title/repository optional, add option -m/--max, major code cleanup, full PEP8 compliance

All changes:
- chart title and repository are now optional and must be set with two
  new options:
    -t, --title (default: hardcoded in script, depends on the chart)
    -r, --repo (default: '.', ie current directory)
- add option -m/--max: max different entries in chart: after this
  number, an entry is counted in "others" (only for charts "authors" and
  "files_type")
- if filename is "-", display SVG content on standard output
- import the new division operator and the print function
- replace %-formatting with .format()
- full PEP8 compliance
- major code cleanup: add comments, dynamically build the names for week
  days and months, use a dynamic name for functions building a chart.
parent 9a367bbb
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -18,20 +18,26 @@ installed with this command:
 
Note: cairosvg is required to generate PNG files.
 
## Usage
See output of command:
$ python gitchart.py -h
## Examples
 
Generate pie chart with authors:
 
$ python gitchart.py authors "Git authors" /path/to/gitrepo/ authors.svg
$ python gitchart.py -t "Git authors on project X" -r /path/to/gitrepo/ authors authors.svg
 
Generate bar chart with commits by year:
 
$ python gitchart.py commits_year "Git commits by year" /path/to/gitrepo/ commits_year.svg
$ python gitchart.py -r /path/to/gitrepo/ commits_year commits_year.svg
 
Generate bar chart with commits by version (tag):
 
$ cd /path/to/gitrepo/
$ git tag | python /path/to/gitchart.py commits_version "Git commits by version" . /tmp/commits_version.svg
$ git tag | python /path/to/gitchart.py commits_version /tmp/commits_version.svg
 
## Demo
 
Loading
Loading
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment