From 54e30e704363e80a20bff934c6bf1f9d1f706d1c Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Thu, 10 Feb 2022 22:32:24 +0000 Subject: [PATCH] Add instructions how to bypass nokeycheck If git cl upload fails due to a private key being detected, print more useful message for git-cl users. R=aravindvasudev@google.com Fixed: 1201742 Change-Id: Ida5c9c9788058dc17c1c50034c9b0b8831cfbd20 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3453203 Auto-Submit: Josip Sokcevic Reviewed-by: Aravind Vasudevan Commit-Queue: Aravind Vasudevan --- git_cl.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/git_cl.py b/git_cl.py index 74f04d9ce..7222404dd 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2289,6 +2289,17 @@ class Changelist(object): 'git cl upload -o uploadvalidator~skip\n\n' 'If git-cl is not working correctly, file a bug under the ' 'Infra>SDK component.') + if 'git push -o nokeycheck' in str(e.stdout): + raise GitPushError( + 'Failed to create a change, very likely due to a private key being ' + 'detected. Please examine output above for the reason of the ' + 'failure.\n' + 'If this is a false positive, you can try to bypass private key ' + 'detection by using push option ' + '-o nokeycheck, e.g.:\n' + 'git cl upload -o nokeycheck\n\n' + 'If git-cl is not working correctly, file a bug under the ' + 'Infra>SDK component.') raise GitPushError( 'Failed to create a change. Please examine output above for the '