[llvm] Have merge script detect whether to use https or ssh to connect to github. (PR #218380)
Douglas Yung via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 04:52:15 PDT 2026
================
@@ -141,11 +141,19 @@ def load_pr_data(self):
)
self.prdata = json.loads(o)
+ # Determine if we use https or ssh to connect to github
+ remote = subprocess.run(
+ ["git", "remote", "get-url", self.args.upstream],
+ capture_output=True,
+ text=True,
+ )
+ upstream_remote_type = remote.stdout.strip().replace("llvm/llvm-project.git", "")
+
# save the baseRefName (target branch) so that we know where to push
self.target_branch = self.prdata["baseRefName"]
srepo = self.prdata["headRepository"]["name"]
sowner = self.prdata["headRepositoryOwner"]["login"]
- self.source_url = f"https://github.com/{sowner}/{srepo}"
+ self.source_url = f"{upstream_remote_type}{sowner}/{srepo}"
----------------
dyung wrote:
@c-rhodes this line doesn't work for me. Locally I have to change it to:
```
self.source_url = f"git at github.com:{sowner}/{srepo}"
```
Not sure how it works for you with ssh if you don't have a similar change.
https://github.com/llvm/llvm-project/pull/218380
More information about the llvm-commits
mailing list