From 9bd40a63c45e834e335121123275ec968d73f1c7 Mon Sep 17 00:00:00 2001 From: thakis Date: Fri, 30 Sep 2016 18:39:15 -0700 Subject: [PATCH] Make merge driver complain about older gits The git coming with Xcode 7.0 is too old to know about %P. Most people will be on newer Xcodes (and Trusty's git and depot_tools's Windows git are new enough), so this doesn't affect most folks -- so just complaining loudly is good enough. BUG=574611 TBR=dpranke Review-Url: https://codereview.chromium.org/2388483004 --- clang_format_merge_driver.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clang_format_merge_driver.py b/clang_format_merge_driver.py index 5f0449a28..9b0cbb943 100755 --- a/clang_format_merge_driver.py +++ b/clang_format_merge_driver.py @@ -27,6 +27,15 @@ def main(): sys.exit(1) base, current, others, file_name_in_tree = sys.argv[1:5] + + if file_name_in_tree == '%P': + print >>sys.stderr + print >>sys.stderr, 'ERROR: clang-format merge driver needs git 2.5+' + if sys.platform == 'darwin': + print >>sys.stderr, 'Upgrade to Xcode 7.2+' + print >>sys.stderr + return 1 + print 'Running clang-format 3-way merge driver on ' + file_name_in_tree try: