Commit 8db83b46b9b3b5701f880ab00fe8f893f6be5d2a
- Diff rendering mode:
- inline
- side by side
git-timecard
(3 / 7)
|   | |||
| 17 | 17 | ||
| 18 | 18 | class TimeHisto(object): | |
| 19 | 19 | ||
| 20 | def __init__(self, ref='HEAD'): | ||
| 20 | def __init__(self, log_args=['HEAD']): | ||
| 21 | 21 | self.h = defaultdict(lambda: 0) | |
| 22 | args = ['git', 'log', '--pretty=format:%at', ref] | ||
| 22 | args = ['git', 'log', '--pretty=format:%at'] + log_args | ||
| 23 | 23 | sub = subprocess.Popen(args, stdout=subprocess.PIPE, close_fds=True) | |
| 24 | 24 | ||
| 25 | 25 | for l in sub.stdout: | |
| … | … | ||
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | 59 | if __name__ == '__main__': | |
| 60 | ref = 'HEAD' | ||
| 61 | if len(sys.argv) > 1: | ||
| 62 | ref = sys.argv[1] | ||
| 63 | |||
| 64 | th = TimeHisto(ref) | ||
| 60 | th = TimeHisto(sys.argv[1:]) | ||
| 65 | 61 | subprocess.check_call(["open", th.to_gchart()]) |

