blob: 4f7b93c0f8d92b6f4ca65114bf11c619e10bf39e [file] [log] [blame]
[email protected]f43d0192010-04-15 02:36:041#!/usr/bin/env python
2# Copyright (c) 2010 The Chromium Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6"""Display log of checkins of one particular developer since a particular
7date. Only works on git dependencies at the moment."""
8
9import gclient_utils
10import optparse
11import os
12import re
13import subprocess
14import sys
15
16
17def show_log(path, authors, since='1 week ago'):
18 """Display log in a single git repo."""
19
20 author_option = ' '.join(['--author=' + author for author in authors])
21 command = ' '.join(['git log', author_option, '--since="%s"' % since,
22 'origin/master', '| git shortlog'])
23 status = subprocess.Popen(['sh', '-c', command],
24 cwd=path,
25 stdout=subprocess.PIPE).communicate()[0].rstrip()
26
27 if len(status.splitlines()) > 0:
28 print '---------- %s ----------' % path
29 print status
30
31
32def main():
33 """Take no arguments."""
34
35 option_parser = optparse.OptionParser()
36 option_parser.add_option("-a", "--author", action="append", default=[])
37 option_parser.add_option("-s", "--since", default="1 week ago")
38 options, args = option_parser.parse_args()
39
40 root, entries = gclient_utils.GetGClientRootAndEntries()
41
42 # which entries map to a git repos?
43 paths = [k for k, v in entries.items() if not re.search('svn', v)]
44 paths.sort()
45
46 for path in paths:
47 dir = os.path.normpath(os.path.join(root, path))
48 show_log(dir, options.author, options.since)
49
50
51if __name__ == '__main__':
52 main()