From 074beb2e46fbefdf85a6ba2526ad7079dd3ceb04 Mon Sep 17 00:00:00 2001 From: thomasanderson Date: Mon, 29 Aug 2016 14:03:20 -0700 Subject: [PATCH] Add --stat option to git-cl diff Review-Url: https://codereview.chromium.org/2285393002 --- git_cl.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index 24a8c99691..a1f58c8561 100755 --- a/git_cl.py +++ b/git_cl.py @@ -4873,6 +4873,11 @@ def CMDset_close(parser, args): def CMDdiff(parser, args): """Shows differences between local tree and last upload.""" + parser.add_option( + '--stat', + action='store_true', + dest='stat', + help='Generate a diffstat') auth.add_auth_options(parser) options, args = parser.parse_args(args) auth_config = auth.extract_auth_config_from_options(options) @@ -4908,7 +4913,11 @@ def CMDdiff(parser, args): # Switch back to starting branch and diff against the temporary # branch containing the latest rietveld patch. - subprocess2.check_call(['git', 'diff', TMP_BRANCH, branch, '--']) + cmd = ['git', 'diff'] + if options.stat: + cmd.append('--stat') + cmd.extend([TMP_BRANCH, branch, '--']) + subprocess2.check_call(cmd) finally: RunGit(['checkout', '-q', branch]) RunGit(['branch', '-D', TMP_BRANCH])