From 9d93221fb9ecd31e5ef9373ffe964c69c05613e2 Mon Sep 17 00:00:00 2001 From: Andrii Shyshkalov Date: Mon, 10 Apr 2017 14:28:23 +0200 Subject: [PATCH] git cl: suggest running git cl creds-check after git push failures. R=sergiyb@chromium.org BUG=708785 Change-Id: Ib29be04cda18b0b1187893e555a4c5a7ea753e6e Reviewed-on: https://chromium-review.googlesource.com/472866 Reviewed-by: Sergiy Byelozyorov Commit-Queue: Andrii Shyshkalov --- git_cl.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/git_cl.py b/git_cl.py index b4dad7a4a..567d4a226 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2984,7 +2984,11 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): filter_fn=lambda _: sys.stdout.flush()) except subprocess2.CalledProcessError: DieWithError('Failed to create a change. Please examine output above ' - 'for the reason of the failure. ', change_desc) + 'for the reason of the failure.\n' + 'Hint: run command below to diangose common Git/Gerrit ' + 'credential problems:\n' + ' git cl creds-check\n', + change_desc) if options.squash: regex = re.compile(r'remote:\s+https?://[\w\-\.\/]*/(\d+)\s.*') @@ -5040,7 +5044,10 @@ def PushToGitWithAutoRebase(remote, branch, original_description, break if IsFatalPushFailure(out): print('Fatal push error. Make sure your .netrc credentials and git ' - 'user.email are correct and you have push access to the repo.') + 'user.email are correct and you have push access to the repo.\n' + 'Hint: run command below to diangose common Git/Gerrit credential ' + 'problems:\n' + ' git cl creds-check\n') break return code