facebook / sapling

A Scalable, User-Friendly Source Control System.
https://sapling-scm.com
GNU General Public License v2.0
6.11k stars 279 forks source link

sl add remote does not work #777

Open kibagare opened 10 months ago

kibagare commented 10 months ago

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?

sggutier commented 10 months ago

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
kibagare commented 10 months ago

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

muirdm commented 10 months ago

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.

danharper commented 10 months ago

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
kibagare commented 10 months ago

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.

karimelazzouni commented 2 months ago

Agreed that this is very confusing. Just spent about an hour trying to push to an existing github repository. I had to use git's workflow at the end. Also, when I finally got my repo in order and wanted to pull the commits I just did with sl, I couldn't pull the whole history (only the last commit) because arguments to sl pull like --unshallow don't exist.