What does HackerNews think of git-branchless?

High-velocity, monorepo-scale workflow for Git

Language: Rust

Some of the recent tool started to come out to fix Git unfriendly UX.

Meta's Sapling (1) is definitely one of them. But there is also `jj` (2) and `git-branchless` (3). These tools target a smaller set of workflow where there is 1 main branch inside a big repo and everything else are short-lived branch/topic that could be treated as ephemeral stack of patches, constantly being uproot / rebase on top of the main branch to derive final result.

If that's the workflow you use daily, then you should give these tools a try.

(1): https://github.com/facebook/sapling (2): https://github.com/martinvonz/jj/ (3): https://github.com/arxanas/git-branchless

> The author's "features from the future" feel to me like they just haven't gotten a good feel for the model.

The author is apparently behind[1] a sucessful alternative UI to Git. It seems safe to assume that they are way beyond merely getting a feel for the Git model.

The Bad-UX denialism has really gone too far when authors like that are dismissed over the old You Just Have To Understand The Model talking point.

[1] https://github.com/arxanas/git-branchless/

To use a similar featureset but in the same Git repository you normally use, you can try my https://github.com/arxanas/git-branchless. Then, you can use your usual staging workflows if desired, or use regular Git commands directly.

Its design is inspired by Sapling, and, in fact, it uses some of the same code, such as the segmented changelog implementation. Possibly some of its ideas made their way back to Meta, such as interactive undo?

Jujutsu also supports colocated Git repositories: https://github.com/martinvonz/jj. It also has the working-copy-as-a-commit idea and conflicts are stored in commits (so rebases always succeed). I think it's a step forward compared to git/hg/sl.

What happens is you work somewhere that has stacked diffs and suddenly you learn how to shape your diffs to make them easy to review. Thinking of how folks will review your code in chunks while writing it makes it cleaner. Having small but easy to read diffs makes reviews faster and helps junior devs learn how to review.

Sometimes this doesn’t happen in which case you end up need to split your commit at the end. This is where git utterly fails. You end up needing git split and git absorb to make this productive.

Git split let’s you select which chunks in a commit should belong to it and then splits that into a commit and then you do it again and again until you have lots of commits. You’ll still need to probably test each one but the majority of the work is done

Git absorb takes changes on the top of your stack and magically finds which commit in your stack the each chunk should belong to and amends it to the right commit

You also need git branchless https://github.com/arxanas/git-branchless as it lets you move up and down the stack without needing to remember so much git arcana.

sort of, but without the commit lineage requirements? I haven't used Gerrit.

It's currently a few lines, looks for the branches and commits based on some strings, and prepares a bash script to run the gh cli to open PRs that are chained/stacked together. Was looking at these for reference.

- https://jg.gg/2018/09/29/stacked-diffs-versus-pull-requests/ - https://github.com/arxanas/git-branchless - https://cli.github.com/manual/gh_pr - https://github.com/arxanas/git-branchless/discussions/45 - https://github.com/stacked-git/stgit/ - https://stackoverflow.com/questions/26619478/are-dependent-p... - https://gist.github.com/Jlevyd15/66743bab4982838932dda4f13f2...

And was hoping for something simple-ish.

Try out the linked tool git-branchless (https://github.com/arxanas/git-branchless, I'm the author). It should help you restore Phabricator-like workflows. In particular, check out the `git sync`, `git restack`, and `git move` commands for handling rebasing and conflict resolution.
The linked tool git-branchless handles this pretty well (https://github.com/arxanas/git-branchless, I'm the author). You basically run `git checkout `, `git commit --amend`, and then `git restack`. This will rebase all dependent branches. As long as you're not using merge commits, you won't have to resolve the same conflict more than once. (It will also warn you up front whether or not merge conflicts will need to be resolved; you can pass `--merge` to start merge conflict resolution.)

To rebase your commit stack on top of the main branch, use `git sync` instead of `git merge`. Merge commits often make it so that you have to resolve conflicts multiple times.

My project https://github.com/arxanas/git-branchless does this. Use `git undo -i` to get a graphical view of where branches were at an arbitrary previous point in time.

It's worth noting that, in principle, there are cases where the reflog will have never observed a branch move. The reflog we usually look at is that of HEAD; if HEAD did not have the branch checked out when it moved, then that information will be lost. (For example, if you run `git branch -f my-branch abc123`, the branch will be forcibly reassigned without having been checked out.) See https://github.com/arxanas/git-branchless/wiki/Architecture#... for more details.

You might be interested in my project git-branchless https://github.com/arxanas/git-branchless or the Git-compatible Jujutsu SCM https://github.com/martinvonz/jj, both of which have version control for commit history via an operation log. Both feature sensible `undo` commands.
Items 2 and 4 are addressed by my git-branchless project: https://github.com/arxanas/git-branchless. You can undo with `git undo`, and merge conflict resolution never starts unless you specify `-m`/`--merge`. There's a UI for item 3 underway as well.
Check out https://github.com/arxanas/git-branchless for `git undo` (and more)!

(arxanas shared a link to my project elsewhere in this thread :))

I didn't see a way to post a comment on the article, so I'll post here. Regarding performance concerns, my own project https://github.com/arxanas/git-branchless is designed to work very fast at monorepo scale.

It primarily supports a patch-stack workflow, but largely using your existing Git workflows. (There is no difference between a patch and a commit, for example; patch identity is implicitly tracked using Git's `post-rewrite` hook.)

To modify the order of patches, you use `git rebase -i`. To modify a patch's content, you can check it out directly and amend it (which will update the descendant patches). To rebase onto another ref, you use `git move`; if it doesn't apply cleanly, then it aborts the operation without ever touching your working copy, unless you pass `--merge` to force conflict resolution.

There are tools out there that attempt to provide a simpler and/or more powerful CLI while letting you collaborate with others on existing Git repos. Gitless has already been mentioned here, but there's also my own tool (https://github.com/martinvonz/jj) and git-branchless (https://github.com/arxanas/git-branchless).
What is the difference between stacked changes and branchless?

https://github.com/arxanas/git-branchless

based off of the branchless Mercurial workflows at large companies such as Google and Facebook

> I'm working on improving monorepo-scale Git tooling at https://github.com/arxanas/git-branchless

I'm intrigued by this but the readme could maybe use some work to describe how you envision it being used day-to-day? All the examples seem to be about using it to fix things but I'm not at all clear how it helps enable a new workflow.

Even if it was just a link to a similar tool?