Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1231)

Unified Diff: git_upstream_diff.py

Issue 184253003: Add git-reup and friends (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@freeze_thaw
Patch Set: fix pylint Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_squash_branch.py ('k') | testing_support/git_test_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_upstream_diff.py
diff --git a/git_upstream_diff.py b/git_upstream_diff.py
new file mode 100755
index 0000000000000000000000000000000000000000..c7fe1f3449cad367d2d629ed24237bb99589dc2a
--- /dev/null
+++ b/git_upstream_diff.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import argparse
+import sys
+
+import subprocess2
+
+from git_common import current_branch, get_or_create_merge_base, config_list
+from git_common import GIT_EXE
+
+def main(args):
+ default_args = config_list('depot-tools.upstream-diff.default-args')
+ args = default_args + args
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--wordwise', action='store_true', default=False,
+ help=(
+ 'Print a colorized wordwise diff '
+ 'instead of line-wise diff'))
+ opts, extra_args = parser.parse_known_args(args)
+
+ cmd = [GIT_EXE, 'diff', '--patience', '-C', '-C']
+ if opts.wordwise:
+ cmd += ['--word-diff=color', r'--word-diff-regex=(\w+|[^[:space:]])']
+ cmd += [get_or_create_merge_base(current_branch())]
+
+ cmd += extra_args
+
+ subprocess2.check_call(cmd)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
« no previous file with comments | « git_squash_branch.py ('k') | testing_support/git_test_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698