From 2d5f039dbf52d49ccfb81d3bd3c9d0479d7fc080 Mon Sep 17 00:00:00 2001 From: Stefan Zager Date: Tue, 10 Oct 2017 15:17:53 -0700 Subject: [PATCH] Support --nocommit option to git-cl-patch for gerrit. R=agable@chromium.org,tandrii@chromium.org Bug: Change-Id: I7a5ec6ca1bb05d67b1ddbee60eac89d57464a480 Reviewed-on: https://chromium-review.googlesource.com/710007 Reviewed-by: Andrii Shyshkalov Commit-Queue: Stefan Zager --- git_cl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git_cl.py b/git_cl.py index 0057b0b2b..1cec90466 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2782,7 +2782,6 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): def CMDPatchWithParsedIssue(self, parsed_issue_arg, reject, nocommit, directory, force): assert not reject - assert not nocommit assert not directory assert parsed_issue_arg.valid @@ -2817,6 +2816,9 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): RunGit(['reset', '--hard', 'FETCH_HEAD']) print('Checked out commit for change %i patchset %i locally' % (parsed_issue_arg.issue, patchset)) + elif nocommit: + RunGit(['cherry-pick', '--no-commit', 'FETCH_HEAD']) + print('Patch applied to index.') else: RunGit(['cherry-pick', 'FETCH_HEAD']) print('Committed patch for change %i patchset %i locally.' % @@ -5408,8 +5410,6 @@ def CMDpatch(parser, args): if cl.IsGerrit(): if options.reject: parser.error('--reject is not supported with Gerrit codereview.') - if options.nocommit: - parser.error('--nocommit is not supported with Gerrit codereview.') if options.directory: parser.error('--directory is not supported with Gerrit codereview.')