Chromium Code Reviews| Index: gclient.py |
| diff --git a/gclient.py b/gclient.py |
| index 88edbd7af489b3034a16a2c4b3cae426af2f5908..8efa5d1a8dfd7cad49fa40022ea857ac7c0ecf89 100755 |
| --- a/gclient.py |
| +++ b/gclient.py |
| @@ -883,6 +883,28 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): |
| # Always parse the DEPS file. |
| self.ParseDepsFile() |
| + |
| + # Setup the merge driver for The Great Blink Reformatting. This does just |
| + # setup a custom merge-driver in the git config of the Chromium main project |
| + # but does not have any effect until somebody changes the .gitattributes |
| + # to refer to it. See crbug.com/574611 for more. |
| + # TODO(primiano): remove some weeks after the reformatting. ETA: Oct 2016. |
| + if parsed_url == CHROMIUM_SRC_URL: |
| + CFG_PREFIX = 'merge.clang_format_merge_driver' |
|
Nico
2016/09/20 21:54:26
I thought I had seen a way to manually pass this t
dcheng
2016/09/20 22:11:19
I think it's:
git mergetool --tool=clang_format_me
Nico
2016/09/20 22:26:48
git mergetool --tool=reformat
git mergetool --tool
dcheng
2016/09/20 22:30:47
Oh right, we can still keep the script in clang_fo
|
| + try: |
| + merge_driver = self._used_scm._Capture( |
| + ['config', CFG_PREFIX + '.driver']).strip() |
| + except subprocess2.CalledProcessError: |
| + merge_driver = None |
| + |
| + if not merge_driver: |
| + print('Installing clang-format merge driver for crbug/574611') |
| + self._used_scm._Capture(['config', CFG_PREFIX + '.name', |
| + 'clang-format merge driver (crbug/574611)']) |
| + self._used_scm._Capture(['config', CFG_PREFIX + '.driver', |
| + 'clang_format_merge_driver %O %A %B %P']) |
| + self._used_scm._Capture(['config', CFG_PREFIX + '.recursive', 'binary']) |
|
Nico
2016/09/20 21:54:26
do we need to set trustExitCode here too, or is th
dcheng
2016/09/20 22:11:19
I'm not sure, honestly. git is magic. It seems to
|
| + |
| self._run_is_done(file_list or [], parsed_url) |
| if command in ('update', 'revert') and not options.noprehooks: |
| self.RunPreDepsHooks() |