Live data from Hacker News

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

engineering.fb.com

251–260 of 543 posts

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

#251

Ah, there it is. I was wondering when this would happen. Facebook used to be involved with the Mercurial community, but it was difficult to work with them. They always wanted to do things their way, had their own intentions, and started to demand that the Mercurial project work the way that Facebook wanted. For example, they demanded that we start using Phabricator and started slowly removing sequential revisions fro…

I switched from git to Mercurial and was absolutely gobsmacked by how much better it is. The only comparison was switching from a Blackberry to an iPhone - everything just works exactly the way I want it to.

Yes, I read the manual for git, but I never needed to for Mercurial.

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

#252
post #87

Thank god. I have been waiting ten years ( https://www.google.com/url?q=https://stevebennett.me/2012/02... ) for someone to develop a better CLI for git, someone with the scale and clout to do it well and gain mindshare. It's not that useful to learn a new workflow if no one you ever work with will be familiar with it. This looks incredible. A simple command to uncommit or unamend makes you further realise what a dis…

My brain immediately jumped to "but you can just git reflog and then copy the state you want to revert to and then git reset --hard ", but not only is that not simple or obvious, it isn't even correct, since a commit or amend operation can be performed with only some of the changes staged, and a hard reset will wipe out anything unstaged. Ah sigh. So yes, in short I agree.

git reset HEAD@{1} should do the trick to "uncommit" and keep uncommitted changes in the absence of conflicts. (I may be missing some edge cases.) It does however unstage changes.

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

#253

Earlier quoted context omitted.

The main problem I have with the staging area is that it amounts to being something that's like a commit except for, you know, not actually being a commit, and therefore things that normally work on commits don't necessarily work on the staging area. A better fix would be to make the staging area an actual commit, and then reframe everything as easy ways to edit the latest commit. (This meshes well with adding featur…

A "draft commit" (I really like that name!) is not a commit, and should not be handled as such. This would make this feature more or less useless. The whole point of the "draft commit" is that you can easily see changes against your (uncommited!) changes. That helps to build up a commit step by step. Committing WIP stuff (and maybe even pushing that) makes the history useless. Branches don't help as you end up with m…

> The whole point of the "draft commit" is that you can easily see changes against your (uncommited!) changes. That helps to build up a commit step by step.

> Committing WIP stuff (and maybe even pushing that) makes the history useless.

Here's the thing. I'm a very big proponent of keeping history clean, and making sure that commits are atomic, and exorcising any "typo fixes" or the like commits from history. Not once have I found the concept of a staging area useful. Features like `git commit --amend` or `git add -i` are incredibly useful [1]. But not the staging area itself--it's only a thing that screws me up if I forget to add `-a` to `git commit`.

"Draft commit" also I think elucidates the other problem. You see, drafts of regular documents are frequently shared with other people, multiple versions of them created and shared, etc. Drafts don't become final until it's actually published--and there is utility in being able to track the differences in drafts as they are discussed. If you've got a "draft commit", then it should be able to go through this process--this is basically the process of code review.

Of course, we're already working with a VCS, which is designed to handle different versions of code, so... what if we made the "version history" of commits just... regular commits? Sure, shade them a different color, so you know that a commit is a draft, and you can tell which of the commit's parents [2] is the previous version. And knowing that a commit is a draft, when it actually gets pushed into the trunk, you can commit only that final commit and not include any of the previous history. Since the commits are using the same DAG logic under the head, questions like "what changed between version 2 and 5?" become just regular diff commands [3].

By the way, this system already exists. It's known as changeset evolution in Mercurial, and it appears that Sapling here has adopted it. My workflow in git tries to emulate this model to a degree, but the approach of having branches-based-on-branches doesn't mesh well with how git wants to do things.

[1] The number of times I have painstakingly sorted out which changes go into the commit with `git add -i` onto to immediately and accidentally undo them with a `git commit -a` is quite high. And because the staging area isn't an actual commit, it can't be recovered by digging into the reflog like actual commits can.

[2] If you amend or otherwise modify a commit, it has one parent, which is the previous version; if you rebase a commit, it has two parents, one of them the new commit it's based on and the other is the previous version.

[3] Worth noting that this question often turns out to be difficult to answer with most code review systems. Building a model of "commit history" into your VCS makes it come out for free!

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

#254
post #202

Earlier quoted context omitted.

GitHub’s success was in part due to it making Git interface’s bareable. Imagine an UX so bad it generates a whole industry.

Lol wut. Github's success is in being a remote code repository.

So your claim is that GitHub would be equally successful if their website was just information about how to push to a git remote hosted by them?

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

#255

Earlier quoted context omitted.

My brain immediately jumped to "but you can just git reflog and then copy the state you want to revert to and then git reset --hard ", but not only is that not simple or obvious, it isn't even correct, since a commit or amend operation can be performed with only some of the changes staged, and a hard reset will wipe out anything unstaged. Ah sigh. So yes, in short I agree.

git reset HEAD@{1} should do the trick to "uncommit" and keep uncommitted changes in the absence of conflicts. (I may be missing some edge cases.) It does however unstage changes.

Right and it is not obvious: git reset HEAD@{1} .

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

#256
post #198
post #87

Thank god. I have been waiting ten years ( https://www.google.com/url?q=https://stevebennett.me/2012/02... ) for someone to develop a better CLI for git, someone with the scale and clout to do it well and gain mindshare. It's not that useful to learn a new workflow if no one you ever work with will be familiar with it. This looks incredible. A simple command to uncommit or unamend makes you further realise what a dis…

Forget the CLI. VSCode implements a ton of git features as commands, which can be bound to any keybindings. For me this is way faster than CLI, as I don’t even need to leave my text editor - I have it set up chorded, so AltG followed by P,U,C,Y, will push (actually sync), pull, commit, undo, respectively. Two keystrokes beats any CLI interaction I’ve seen. (Disclaimer used to make VSCode)

I agree why should I switch from editor to terminal to do a commit. In WebStorm it is Ctrl-K plus adding the commit-message.

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

#257
How I wish there was a company that did something similar to monstrosity Android development abd build tools are. Nonetheless it’s an excellent news. While I won’t call it a monstrosity Git was so untenable and obtuse that I only used it because everybody else used it.

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

#258
post #228

Earlier quoted context omitted.

because doing a commit with one keystroke is a good thing? i think it isn't - i like to consider things, rather than program like a hyperactive cockroach

You still gotta type the message.

I think the original poster was referring to staging the commit as their "thinking" step, not composing the message.

Personally, my workflow is to make many changes, then use `add -p` and `commit` to create a series of small commits. While staging, you might decide that you don't want to commit some bit of code and `restore -p` to toss it away.

I think your workflow would work well if you see commits as "development checkpoints" rather than semantic patches. It's not an invalid workflow, just a different one.

I'm sure you could configure VSC to be analogously ergonomic for any git workflow. But people who are comfortable with git and their shell of choice tend to develop comfortable workflows in the terminal as well.

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

#259

How I wish there was a company that did something similar to monstrosity Android development abd build tools are. Nonetheless it’s an excellent news. While I won’t call it a monstrosity Git was so untenable and obtuse that I only used it because everybody else used it.

[deleted]

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

#260
post #70

Earlier quoted context omitted.

Fortunately, zstd seems to be in active development: https://github.com/facebook/zstd As far as I can tell, most of zstd's development is still by Facebook employees, though not all of it. I tend to think zstd has enough traction that development would continue even if FB were to abandon the project.

This is probably a naive take, but I think of compression software as something that can be “done”. Unlikely to be a lot of code churn required for such a project to be relevant for a very long time.

Except for the fact that zstd has seen steady development and improved performance.
Post reply on HN