Live data from Hacker News

Sapling: A new source control system with Git-compatible client

engineering.fb.com

51–60 of 543 posts

Re: Sapling: A new source control system with Git-compatible client

#51

Earlier quoted context omitted.

It's simply not necessary to have that feature. Sapling encourages regularly committing and amending commits rather than staging changes. It's also easy to commit / amend part of your work by selecting the lines to include in nice curses interface (--interactive).

I agree it's not necessary, but i like having it because it lets me separate what's going to be added before i actually commit. I still commit small, frequent. But i like `git add -p` to skip debug lines, hardcoded conditions, etc. I don't want to mistakenly auto commit a whole pile of lines and then have to remove debugs/hacks/etc from things i've committed. Stage + Unstaged is my working area, and the two live toge…

> Stage + Unstaged is my working area, and the two live together quite nicely to me personally. I could live without it, definitely.. but i'm not sure i'd want to.

You can just use the tip as your staging. Use interactive amending to move changes from the working copy to the commit, and when you want to "commit", finish up the message.

hg actually has an "unamend" command (part of the "uncommit" standard extension) which... reverts the last amend. Rather than having to remember how to contort reset into the right shape to move changes back out of staging without destroying everything.

Re: Sapling: A new source control system with Git-compatible client

#52
post #38

Would the team consider discussing the architecture of this system? Seems like a whole lot of Rust was used. I'm sure the team has a lot to share.

Yes. Right now we are adding more documents about how internal components (like the commit graph) work. We hope others in the industry find them useful. Feel free to ask questions in GitHub too.

Re: Sapling: A new source control system with Git-compatible client

#53
post #41

Earlier quoted context omitted.

Instead of `git add -p`, you would use `sl commit -i` (whose interface I much prefer). To amend into a previous commit, I prefer to switch to it and then just use `sl amend` (+ `sl restack` if necessary), but you can also use `sl fold` IIRC. Instead of `git rebase -i`, you can use `sl histedit` (not a direct replacement for autosquashing, but worth mentioning). To split a single commit, you can use `sl split`, which…

If I switch to a previous commit to amend it, then I would temporarily lose all the other changes I made, and means I can't easily run tests on that particular commit to validate nothing else broke. It sounds like I would need to: - switch - amend the commit - restack? - switch back to the HEAD? Fold based upon the documentation seems to move older commits into the current commit? vs the other way around? https://sap…

Yes, in my preferred workflow, I usually create a temporary commit and then switch away. Sapling also has `sl shelve` as `git stash`.

If you want to run tests on commits without checking them out, you might want to try my `git test` command: https://github.com/arxanas/git-branchless/discussions/643

You can use `sl fold --exact` to combine arbitrary commits without including the current one. (To be honest, I just always used `sl histedit`.)

Re: Sapling: A new source control system with Git-compatible client

#54
Major pain point of monorepos: Merge-conflicts. When a merge-conflict happens YOU need to be expert and resolve all conflicts the right way, across the many unrelated domains mixed together.

How does sapling solve that? It can't...

IMHO Sapling looks like "Git for dummies". And Git teaches some pretty useful concepts, which are worth it.

Re: Sapling: A new source control system with Git-compatible client

#55
post #50

Phabricator[0]: code review/CI solution from Facebook. My company uses it, open development has since been halted by Facebook and we're effectively on abandonware. Flow[1]: JavaScript typing system from Facebook. My company uses it, open development has since been halted by Facebook so we're effectively on abandonware. EDIT: React: Javascript framework from Facebook, my company uses it, and while it has its warts it…

Disclaimer: I work at Facebook.

Your thought process is completely fair, but just to clarify: Phabricator was never open-sourced by Facebook. The main engineer behind Phabricator (Evan Priestley) left Facebook to create Phacility and open-source Phabricator; that was never a Facebook product.

Re: Sapling: A new source control system with Git-compatible client

#56

> There is no staging area. I don't actually want "No" staging area. What I want is, once I "add" something, the file stays added. Currently, I have `git st` alias setup : st = !git add -u && git status This auto-updates the staging area for files that were previously staged. So I get `git add` but also don't have to re-add anything manually from there ... Since I do `git st` quite frequently, this works out for me .…

That seems like the worst possible use of the staging there is, it creates overhead and complicates diffing for no value whatsoever.

If you want that behaviour, you can just `git commit -a` when you create your commit, then you only have to "git add" brand new unknown files.

Re: Sapling: A new source control system with Git-compatible client

#57
The interactive tool looks amazing. I do interactive rebases quite often and a drag-drop setup is wonderful

However, I don't understand why I would want 1 PR per commit. I feel like that's a non-starter for me.

Is the idea that no one should use branches - so there's only 3 points of interest: HEAD, main, and origin/main? And then is the idea that it's only 1 commit per feature to merge?

So I would work on something, make a PR, continue working on something else without making any git checkouts and then make a new PR?

Re: Sapling: A new source control system with Git-compatible client

#58
post #24

Not a big fan of FB as a company, but I think their open source work is pretty impressive. Various other large companies have the problem of giant monorepos that they constantly need to onboard new developers to, but I can't think of anyone other than FB who consistently released their solutions. Sure, most people are probably fine with Git once they learned it and if they only work with small to mid sized code bases…

Facebook has a lot of interesting open source projects, but they tend to abandon them. As far as oss goes, I think Google is the best. As long as you don't mind dealing with 3 different custom build systems within the same codebase, their projects usually have dedicated teams maintaining them.

...and yes, I realize it's weird to say this considering Google is known for abandoning things. Maybe it's just coincidence that I've run into more abandonware from FB than Google?

Re: Sapling: A new source control system with Git-compatible client

#59
post #50

Phabricator[0]: code review/CI solution from Facebook. My company uses it, open development has since been halted by Facebook and we're effectively on abandonware. Flow[1]: JavaScript typing system from Facebook. My company uses it, open development has since been halted by Facebook so we're effectively on abandonware. EDIT: React: Javascript framework from Facebook, my company uses it, and while it has its warts it…

It’s not that hard to convert Flow code to TypeScript code.

Re: Sapling: A new source control system with Git-compatible client

#60
post #50

Phabricator[0]: code review/CI solution from Facebook. My company uses it, open development has since been halted by Facebook and we're effectively on abandonware. Flow[1]: JavaScript typing system from Facebook. My company uses it, open development has since been halted by Facebook so we're effectively on abandonware. EDIT: React: Javascript framework from Facebook, my company uses it, and while it has its warts it…

It's worth pointing out:

React[0]: JavaScript front-end web framework from Facebook. For good or ill, the most widely-used web framework in the world.

Not to say that Facebook will maintain Sapling, but React does stand as proof that they're not incapable of carrying an open source project to the finish line.

[0] https://github.com/facebook/react

Post reply on HN