sapling
sapling copied to clipboard
[pr]: open PR from fork to upstream
❯ sl paths
default = ssh://[email protected]/vim/vim.git
github = ssh://[email protected]/vegerot/vim.git
upstream = ssh://[email protected]/vim/vim.git
I want to open a PR on default
from a commit on github
.
❯ sl pr submit
pushing 1 to ssh://[email protected]/vim/vim.git
abort: `git --git-dir /Users/m0c0j7y/workspace/github.com/vim/vim/.sl/store/git push --force ssh://[email protected]/vim/vim.git 550ada1e774a914c2269acba26a0bec279a9b920:refs/heads/pr11684` failed with exit code 128: stdout:
stderr: ERROR: Permission to vim/vim.git denied to vegerot.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I cannot find any docs in sl help pr submit
that lets me specify a path
Hi @vegerot thanks for reporting the issue. Currently, pr is pushing to the default
path, how about making your own repo as the default path like below?
default = ssh://[email protected]/vegerot/vim.git
upstream = ssh://[email protected]/vim/vim.git
@zzl0 thanks, I'll try that!
Before I try it, just wondering: will sl pr
open the PR from vegerot/vim:mybranch→vim/vim:master
or vegerot/vim:mybranch→vegerot/vim:master
?
assuming you forked from vim/vim
, it will be the former vegerot/vim
→ vim/vim
Perfect! 🤩
FYI since I bet this a common problem for people contributing to open source, we should either document this workflow and/or add a --path
parameter to sl pr submit
@vegerot Thank you for the suggestion, I will update the document of the workflow.
For --path
parameter, we need to think this together with other requirements, and it's on our plan.
I noticed in the documentation that in "hg" there is default
and default-push
. Would it be possible to use default-push
for prs?
Curiously when edited .sl/config
as described above
% cat .sl/config
%include builtin:git.rc
[paths]
upstream = https://github.com/facebook/sapling.git
default = https://github.com/discentem/sapling.git
sl pr
pushed directly to main
on https://github.com/discentem/sapling.git and immediately opened a PR to upstream
. Is upstream
a like hidden keyword that Sapling knows about already but is only surfaced via the .sl/config
interface? ➕ 1 to this idea of adding a flag for this: https://github.com/facebook/sapling/issues/312#issuecomment-1344769084
This magic "upstream" behavior doesn't seem to extend to ghstack either.