[PATCH] D71534: git-llvm: Add option to push to Github with SSH

Valentin Churavy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 14:01:38 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG38dd2d50924a: git-llvm: Add option to push to Github with SSH (authored by vchuravy).

Changed prior to commit:
  https://reviews.llvm.org/D71534?vs=234002&id=234145#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71534/new/

https://reviews.llvm.org/D71534

Files:
  llvm/utils/git-svn/git-llvm


Index: llvm/utils/git-svn/git-llvm
===================================================================
--- llvm/utils/git-svn/git-llvm
+++ llvm/utils/git-svn/git-llvm
@@ -206,7 +206,7 @@
 def get_push_url(user='', ssh=False):
 
     if ssh:
-        return 'ssh://{}'.format(GIT_URL)
+        return 'ssh://git@{}'.format(GIT_URL)
 
     return 'https://{}'.format(GIT_URL)
 
@@ -221,7 +221,7 @@
     return commits
 
 
-def git_push_one_rev(rev, dry_run, branch):
+def git_push_one_rev(rev, dry_run, branch, ssh):
     # Check if this a merge commit by counting the number of parent commits.
     # More than 1 parent commmit means this is a merge.
     num_parents = len(git('show', '--no-patch', '--format="%P"', rev).split())
@@ -237,7 +237,7 @@
         return
 
     # Second push to actually push the commit
-    git('push', get_push_url(), '{}:{}'.format(rev, branch), print_raw_stderr=True)
+    git('push', get_push_url(ssh=ssh), '{}:{}'.format(rev, branch), print_raw_stderr=True)
 
 
 def cmd_push(args):
@@ -261,7 +261,7 @@
             die("Aborting")
 
     for r in revs:
-        git_push_one_rev(r, dry_run, args.branch)
+        git_push_one_rev(r, dry_run, args.branch, args.ssh)
 
 
 if __name__ == '__main__':
@@ -293,6 +293,13 @@
         'repo, so probably will not work well if you try to commit more '
         'than one rev.')
     parser_push.add_argument(
+        '-s',
+        '--ssh',
+        dest='ssh',
+        action='store_true',
+        help='Use the SSH protocol for authentication, '
+        'instead of HTTPS with username and password.')
+    parser_push.add_argument(
         '-f',
         '--force',
         action='store_true',


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71534.234145.patch
Type: text/x-patch
Size: 1680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191216/73f02640/attachment.bin>


More information about the llvm-commits mailing list