Live data from Hacker News

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

engineering.fb.com

451–460 of 543 posts

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

#451

Earlier quoted context omitted.

Due to my workplace I moved from svn to hg (awesome experience) and then from hg to git (terrible experience). That was years ago, and the git experience remains terrible.

Can you elucidate? What did you find appealing/unappealing?

If you're interested, can compare tfs to git. Maybe it's ide integration quality, but FWIW:

1) tfs: shelves are named and can be worked with independently; git: stashes are numbered in a sort of a stack and only the top stash is unpacked and deleted destroying your data, infuriating, also local edits are moved into the stash, not copied.

2) tfs: branches are mapped to different folders and can be worked on simultaneously; git: branches are mapped to single folder and switching branches deletes local edits.

3) tfs: pulling from server merges new text preserving local changes; git: pull and checkout deletes local changes.

4) tfs: can't commit unresolved merge conflicts; git: commits just fine, it's also not obvious if you have merge conflicts to commit or not.

5) tfs: handles concurrent edits as merge conflicts and handles them as they occur; git: you create feature branches and in case of concurrent branches you have merge conflicts when you merge to master, then you have p.4. Feature branches are advertised as a big fat killer feature of git, but I don't quite see the win here, you still have merge conflicts.

6) tfs: all commits in a branch are visible, it's not obvious how to delete them, you can only create rollback commits; git: if something happens to the branch label, the commits are gone.

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

#452
post #358

Earlier quoted context omitted.

'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?

Sorry! '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.

I 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.

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

#453

Earlier quoted context omitted.

I think you're demonstrating the original point

And that would be? That Git is able to handle even completely weird requirements, like making history disappear?

That doing even a simple a action often requires understanding multiple esoteric concepts, and knowing even more-esoteric commands/options.

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

#454

Earlier quoted context omitted.

I certainly recognized several Mercurial features and concepts in Sapling. For example, I use Mercurial’s absorb command [1] and was pleased to see it in Sapling. Overall this looks promising. [1]: https://gregoryszorc.com/blog/2018/11/05/absorbing-commit-ch...

Absorb is amazing! Even if you don't take up Sapling, there's a 'git absorb' plugin which I have found absolutely invaluable: https://github.com/tummychow/git-absorb

thanks for the reference, using `git-fixup` myself since years: https://github.com/keis/git-fixup

Will try `git-absorb`.

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

#455
post #407

Earlier quoted context omitted.

There is git-fixup, which provides the 'git fixup' command that makes suggestions to which commit the currently staged changes should be added. https://github.com/keis/git-fixup git-fixup will add fixup! commits, so it still needs the mentioned 'git rebase -i --autosquash' afterwards. Usually you do not even need to give it a specific commit if your branch is set to track an upstream branch.

Still not quite the same, because absorb splits up your working directory changes into all relevant commits, as deduced by diff context.

Staged or unstaged? Sounds interesting, will give it a try. Thanks for the details.

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

#456

Earlier quoted context omitted.

And that would be? That Git is able to handle even completely weird requirements, like making history disappear?

That doing even a simple a action often requires understanding multiple esoteric concepts, and knowing even more-esoteric commands/options.

Making committed history disappear isn't something I would call a "simple action". That's something that is almost never needed.

The common case it to amend mistakes. Git makes it very easy to accomplish that.

The other thing is: Git is conceptually very simple. There are almost no "esoteric" concepts. It's just a Merkle tree and some pointers to nodes on top of a very simple plain-text database.

My experience with people that have problems to understand Git is that most of the time those people never tried to understand how Git actually works. But everything (besides the concrete commands and switches, oc) becomes almost obvious when knowing the inner workings.

The main problem with Git is its UX.

I don't know anything of this stuff out of the top of my head! I have to look up the concrete commands or switches every time. But from the conceptual point of view Git is very easy to use. Because the underlying concepts are indeed so simple and straight forward.

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

#457

I use the staging area to allow me to more easily break larger changes into smaller commits. I am usually all over the place while writing/refactoring code and making commits as I go along doesn't work well. How does sapling let me take a long list of commits and break them into larger but more manageable chunks? git add -p allows me to add chunks easily and create commits, git commit --fixup allows me to mark a comm…

`git add -e` is even more amazing.

I also use this workflow. Lots of detached HEAD mode, using the index to commit things piecemeal, then rebase as needed, until I'm finally done.

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

#458
post #304

Earlier quoted context omitted.

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.

Not really. I'm not sure I want it to behave the way GP suggests, but I definitely want to have staging, and `git commit -a` is basically an equivalent of having no staging. The reasons for that are: 1. In the vast majority of cases there are multiple files I want to commit together. Usually I change them multiple times during the process. 2. It almost always starts with some debugging in a couple of other files, and…

> Not really. I'm not sure I want it to behave the way GP suggests, but I definitely want to have staging

So I'm replying to OP's very specific usage pattern, and you object with a completely different usage pattern?

> `git commit -a` is basically an equivalent of having no staging.

GP doesn't use the staging as a staging, since they immediately stage all modified files. That means the staging is useless, they can just commit files straight from modified. Which is what `git commit -a` does.

> 1. In the vast majority of cases there are multiple files I want to commit together. Usually I change them multiple times during the process.

OK? `git commit -a` doesn't preclude that. You just use it instead of `git commit`.

> 2. It almost always starts with some debugging in a couple of other files, and I often want to keep that debugging for a couple of next commits, but `git checkout HEAD` these files in the end.

I'm really happy for you. It doesn't work when the files are already staged, which is the case of GP.

> 3. For me, the most popular way of using git rebase → edit (which I do reasonably often) is splitting a commit into 2 by separating files. This is easy enough by just changing a status of a file from "staged" to "modified" (I even have `git unstage` alias for that) and commiting.

https://sapling-scm.com/docs/commands/uncommit

> uncommit part or all of the current commit

You don't need a staging area to craft commits, you can manipulate the tip commit directly. With good enough support for that (which sapling seems to have inherited from mercurial), the staging is just an unnecessary pseudo-commit.

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

#459

Earlier quoted context omitted.

That doing even a simple a action often requires understanding multiple esoteric concepts, and knowing even more-esoteric commands/options.

Making committed history disappear isn't something I would call a "simple action". That's something that is almost never needed. The common case it to amend mistakes. Git makes it very easy to accomplish that . The other thing is: Git is conceptually very simple. There are almost no "esoteric" concepts. It's just a Merkle tree and some pointers to nodes on top of a very simple plain-text database. My experience with…

> The main problem with Git is its UX

The UX is exactly what we're talking about, yes

I have a CS background and I don't even know what a Merkle tree is without looking it up, and I'm sure after looking it up I'd have to do more digging/research before it gave me a clear mental model of how git works. I'm pretty comfortable in git at this point - I know how to navigate the space of normal-ish states - but that came after years of exposure.

For a person who's learning to code, who's expected to jump straight into GitHub as a part of their very first real project, the situation is kafkaesque.

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

#460

Earlier quoted context omitted.

Due to my workplace I moved from svn to hg (awesome experience) and then from hg to git (terrible experience). That was years ago, and the git experience remains terrible.

Can you elucidate? What did you find appealing/unappealing?

> What did you find appealing/unappealing?

The entire CLI is badly designed, with highly non-orthogonal commands interacting in unexpected ways. Recent versions of git has started introducing commands with a more top-down design (e.g. git switch), but that's a very novel development

Git also diverged significantly from the SVN command line, but instead of following the tasteful Darcs path of making commands clearer and cleaner it commonly:

- reused the same terms for different operations, usually less intuitive ones (e.g. the absolutely awful "git revert")

- removed clear commands to confusingly tack them onto others (e.g. "git add" to resolve commits)\

On that front, mercurial extended the existing commands-set much more cleanly and clearly.

Mercurial's CLI felt like an improved extension of SVN's, Darcs felt like a drastically different take with plenty for it, Git's felt like one of those ransom letters cut out of newspapers, full of jangly bits which make little sense, and concepts which worked fine altered for no perceivable reason.

Post reply on HN