top | item 43024592

(no title)

steinuil | 1 year ago

Sounds like you'd enjoy using JJ! It looks to me that you have this workflow to work around git's poor tooling for manipulating local commits before pushing. JJ makes that very easy!

Forgot to add something to a previous commit? Run "jj squash -i" to move the lines you select to whatever commit you want. Or you can run "jj edit" to check out that commit and edit it directly.

Want to split a commit into two separate commits? Run "jj split".

Need to reorder commits? Run "jj rebase", and if you have a conflict you can "jj edit" the commits that are marked as conflicted to fix it later, unlike Git where you have to run through a lengthy process of fixing conflicts on commits you don't remember and then review the changes later to see whether they still make sense.

If you want to have a messy working copy of your repo that's very easy to do. The workflow would mostly involve:

- Develop the feature

- "jj split" to pick out the stuff you need into a separate commit, which will appear between master and the working copy commit

- "jj describe" to add a commit message

- "jj bookmark set feature-branch" on the commit containing the stuff you want to push

- "jj git push" to push it

- "jj edit" to return to the commit containing the working copy.

You'd end up with a tree that looks kind of like this:

    @  ptswumyk 2025-02-12 13:16:36 de46f8c1
    │  messy working copy
    ○  slwozrlr 2025-02-12 13:16:22 feature-branch@origin d3d246a1
    │  feature implementation
    ◆  tssssuzr 2025-02-12 12:34:28 master* 8a9bab0f
    │  generate flake registry from inputs
    ~
So it's not that I really need more features to git, just a better UX, which is what JJ provides.

discuss

order

No comments yet.