sapling icon indicating copy to clipboard operation
sapling copied to clipboard

sl add remote does not work

Open kibagare opened this issue 1 year ago • 6 comments

I have a local sl repository which I want to push to github.

The basic commands have nothing on push. The push documentation seems to assume that you have a remote added already.

The Git cheat sheet says that the equivalent of git remote add REMOTE URL is sl path --add REMOTE URL. When I do that, I get abort: invalid URL - invoke as 'sl paths -a NAME URL'. When I do sl paths -a <my url> I get the same error message.

How does this work?

kibagare avatar Nov 18 '23 09:11 kibagare

Can you share what you are passing as REMOTE and as URL? Usually I run it with something like

sl path --add personalfork https://github.com/sggutier/sapling

sggutier avatar Nov 20 '23 02:11 sggutier

after initialising sl and making a commit, made a new repository on github, then:

sl path --add main https://github.com/kibagare/distances.git
sl push --to main

which gives: abort: use '--to' to specify destination bookmark

kibagare avatar Nov 24 '23 12:11 kibagare

The [DEST] is a positional argument, so sl push main --to <branch name>.

sl push --help -v has one illustrative example "hg push --rev 05a82320d my-fork --to my-branch --force", but that should not be so buried. We also should rethink the "--to" option since it is so ambiguous.

muirdm avatar Nov 28 '23 16:11 muirdm

I love using sl, but agree that adding a remote is just the hardest thing 😅 --to sounds like it should be the remote name, not the branch name. Perhaps this one-liner could be added to the cheatsheet?

sl path --add default URL
sl push default --to main

# default being a special name to sapling, in the docs
# main being the remote branch name

e.g. instead of GitHub's default instructions for a new repo:

git remote add origin https://github.com/...
git push -u origin main

You should:

sl path --add default https://github.com/...
sl push default --to main

danharper avatar Dec 02 '23 16:12 danharper

Adding a remote and pushing to it should be as simple as possible. What is proposed here sounds more complicated than git, which defies the whole idea of developing a simple version control system. I hope we can come up with something more compact than this.

kibagare avatar Dec 04 '23 07:12 kibagare