8 ms·
Hi Hacker News! Author of the Sapling blog post here. I'm happy to answer any questions you might have.
by durham_meta 4y ago
Hi Hacker News! Author of the Sapling blog post here. I'm happy to answer any questions you might have.
- thijser 4y agoThe GitHub repo says that Mononoke and EdenFS is "not yet supported publicly". The code seems to be all in the open source repository though, what does the "not supported" mean here?
- durham_meta 4y agoThe code is available to see, but they don't necessarily build in an external environment yet and even if they did we aren't ready to support them being used externally. Hopefully we can support them one day, but for now we're just starting with the client.
- wocram 4y ago'one day' is not very reassuring! Improved UX is nice and all, but why would anyone migrate without getting killer performance features like the virtual file system?
- durham_meta 4y agoSorry! 'one day' is the best I can do for now. We'd love to do it sooner, just gotta find the time. We think, and many of our internal users agree, that the UX alone is a worth while upgrade. Since the majority of Git repos don't actually need the performance of a virtual filesystem, the UX is the main sell for them anyway. At the very least maybe it will inspire some UX improvements in Git.
- wocram 4y agoI don't doubt the UX is better, but internal users are a captive audience. I imagine most developers will not think twice about what vcs they are using unless their organization makes the change.
- chadaustin 4y agoEdenFS builds (and probably runs?) from GitHub, but we have done no work to make it usable and hook it up to an existing checkout. It may not be much effort, and we're hoping to demonstrate that workflow in the future.
- yewenjie 4y agoI believe at some point the GitHub project used to be called Eden, right? When was the name changed and why?
- durham_meta 4y agoGood memory! Internally Eden eventually became synonymous with our virtual filesystem, so we decided it was better to choose a new name to avoid that confusion.
- thijser 4y agoI'm curious about the tech stack. It seems to be a combination of Rust and Python? How does that exactly work?
- durham_meta 4y agoSapling originated from the Mercurial open source project, which was largely Python (at the time). To make things faster and more maintainable, we started rewriting portions of it in Rust, and going through a binding layer to interact with Python. Critical pieces like the storage layer, parts of the wire protocol, and various others are all in Rust at this point, while a lot of the high level business logic remains in Python. We'll continue to shift more to Rust over time though, especially since pure-Rust Sapling commands feel way more snappy and pleasant to use.
- alwillis 4y agoSapling originated from the Mercurial open source project, which was largely Python (at the time). Just to finish up, most of Mercurial has been rewritten in Rust, although the Python version is still the default install.
- neandrake 4y agoIt's difficult to find out information about the status of the oxidation project with Mercurial. I just noticed the 6.3 release earlier today and looked more into the rust support. I didn't get the feeling that most of Mercurial has been rewritten in Rust yet. The `hg help rust` information only lists a handful of features as gaining improvements from Rust, albeit they are likely core/essential components, as well as mentioning some/all of the work is experimental. The documentation here seems very much directed towards developers still.
- jcranmer 4y agoIs it possible to use git commands on an sl checked out repository, or vice versa? Or at least get something close enough to a git repository that I could run git commands on it, so I can fake it for internal tooling?
- durham_meta 4y agoUnfortunately you can't run git commands directly right now, since there is no .git directory at the root of the repo. Under the hood there is a .git directory hidden away somewhere under the .sl directory, but we consider that an implementation detail and are likely to change how we store the actual git data in the future. So we don't support people running git commands in there.
- epage 4y agoLooks like you are using clap v2? Feel free to ping me for help on moving to v3 then v4. I expect the rate of breaking changes to be slowing down and to be smaller in scope (from the users perspective) so now is a good time. Id love to hear how we can make clap better fit cases like this and how we can help in improving the UX of applications.
- durham_meta 4y agoWe're somewhat limited by what version of clap is available in our internal monorepo. We try to keep things reasonably up-to-date though, so I'm sure we'll upgrade at some point. I believe we actually only use clap for some side binaries, not for the main sl executable. We have a custom parser for that (https://github.com/facebook/sapling/tree/main/eden/scm/lib/cliparser/src https://github.com/facebook/sapling/tree/main/eden/scm/lib/c...), to match the preexisting hg parse behavior. Unfortunately I'm not familiar enough with clap or why we didn't go with clap in the first place to say what we would need to use clap for the main binary.
- neandrake 4y agoSince the sapling client is a fork from Mercurial does that mean it can also be used with Mercurial repositories in addition to Git repositories or is that not supported? In order to work with Git repositories is this essentially the Mercurial client using hg-git on a converted repo under the hood?
- durham_meta 4y agoUnfortunately you can't use Sapling with Mercurial repositories. There are too many differences at this point. This does not use hg-git under the hood. Sapling's internal structure differs from Mercurial in substantial ways, and we've built some cleaner layering that allowed us to shim Git in under our storage layer. This also means that we read and write directly to the git repo, instead of duplicating and importing all the data like hg-git did. This has some nice benefits, like the hashes you see in the output are actually Git hashes.
- quark12 4y agohttps://sapling-scm.com/docs/internals/internal-difference-hg/#git-support https://sapling-scm.com/docs/internals/internal-difference-h... briefly explains the Git support. Currently we keep trees and blobs in a git bare repo unchanged, but convert the commit graph to our format so we can run our own graph algorithms. In the future we might store trees and blobs differently too.
- dastbe 4y agocan you speak to commit throughput of the sapling server? While there's tooling to make git scale better (like sparse checkouts) scaling commit throughput for automation is a pain.
- durham_meta 4y agoUnfortunately we can't really talk too much about that at this point. I can say a lot of effort has gone in on the server side to optimize commit throughput though. One example we mention in the blog post is that when you push, it doesn't actually need to be a fast-foward push (using Git terminology) to succeed. Our server can rebase the commit on top of the destination bookmark for you (with some limitations, like not merging file contents). This allows many people to push, and not have to race to rebase. Then we have substantial optimizations around the critical section of final-rebase-then-move-branch-forward, which yields pretty good throughput.
- bentcorner 4y agoHopefully a dumb question that I missed an answer for in the docs. If I have an existing git repo (not hosted on github), is there a way to try using sapling with it? Or do I need to clone it from scratch? My impression from the blog post is that I can use sapling and have everything "look" git-like from the remote repo's point of view.
- durham_meta 4y agoYou should be able to `sl clone ...` your git repo into a Sapling clone and use it that way, even if the repository is not on Github. I haven't personally tried whether cloning like `sl clone /path/to/some/repo` works, but it should since we're actually using the actual git binary under the hood for clone, pull, and push.
- bentcorner 4y agoJust to clarify, I meant that I've already cloned it via git. Can I just start using sapling with it or do I need to delete the local repo and re-clone it with sapling?
- durham_meta 4y agoYou cannot just start using sl in a git repo. You need to make a Sapling clone of it. But you can make a Sapling clone of your local git repository, so you don't have to clone from the server again and you would get all your local work from your git repo. That might be the easiest way to try Sapling, so you don't have to delete your git checkout at all.
- achsvg 4y agoWhat's the command in sl to clone a local git repo? The documentation does not say anything about it...
- bentcorner 4y ago> But you can make a Sapling clone of your local git repository Whoa I didn't even know you could do that in git. I always considered clone to mean "download stuff from this location" but now it makes more sense. Thanks I'll give that a try.
- jsmeaton 4y agoDoes sapling support hooks like pre and post commit? My workflow leans on pre-commit (the framework) heavily and it would be hard to give that up. I’d still be keen to take this for a drive though, nice work!
- durham_meta 4y agoTechnically the mercurial pre and post hooks are mostly still there, but I'm not certain we want to support them long term. The existing hook design has some problems. I'd be curious about your use case, since we don't actually use hooks internally all that much.
- anentropic 4y agoNot the OP, but I've worked on a bunch of projects which use https://pre-commit.com/ https://pre-commit.com/ that ties into git pre-commit hooks (or https://typicode.github.io/husky/#/ https://typicode.github.io/husky/#/ is another) usually to run linters and validators, speeding up the feedback loop (otherwise it's annoying to push changes to a PR and then get a CI failure minutes later for trivial linting issue)
- jsmeaton 4y agoSame here. That’s the framework we use to lint before accepting a commit.
- trilobyte 4y agoThank you for answering questions. I was poking around Sapling and got thrown off track pretty quickly. Just wanted to init an empty repo but on an Intel MBP I just get an error: `abort: please use 'sl init --git .' for a better experience` What's going on here? I couldn't find info in the `sl init --help --verbose` output or in the Sapling website.
- durham_meta 4y agoBecause we haven't released the server yet, the open source client currently only really supports git right now, so sl init --git is the only way to init a local repo for now. Perhaps we could make that message clearer. I'll take a look at the help later to see what we're missing here.
- trilobyte 4y agoCool, thanks for the reply. It definitely threw me off and if it only supports git as a backend for the open source user it might make sense if it can default that way for now.
- anentropic 4y agoA minor question... https://sapling-scm.com/docs/introduction/installation/#macos https://sapling-scm.com/docs/introduction/installation/#maco... The "download via curl and then install with homebrew" method struck me as unusual Were there problems getting Homebrew bottle building/publishing work as you needed?
- durham_meta 4y agoYea, that's on our list to fix. The homebrew packaging was the last package to be done, and we were busy tidying up other things in the lead up to launch.
- sicariusnoctis 4y agoFor a given repository, is it possible to have multiple worktrees for different "branches"? (Just like git worktree.)
- nulltype 4y agoHow hard is it for me to have a commit stack be represented as a series of PRs on Github?