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.
6 """Display log of checkins of one particular developer since a particular
7 date. Only works on git dependencies at the moment."""
17 def show_log(path, authors, since='1 week ago'):
18 """Display log in a single git repo."""
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],
25 stdout=subprocess.PIPE).communicate()[0].rstrip()
27 if len(status.splitlines()) > 0:
28 print '---------- %s ----------' % path
33 """Take no arguments."""
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()
40 root, entries = gclient_utils.GetGClientRootAndEntries()
42 # which entries map to a git repos?
43 paths = [k for k, v in entries.items() if not re.search('svn', v)]
47 dir = os.path.normpath(os.path.join(root, path))
48 show_log(dir, options.author, options.since)
51 if __name__ == '__main__':