July 1st, 2024

A Better Merge Workflow with Jujutsu

A new merge workflow using Jujutsu, a modern VCS compatible with Git, introduces The Austin™ Mega Merge Strategy®. It simplifies merge commits, amending commits, and selecting commits efficiently, enhancing collaboration and code review processes with advanced commit graph manipulation.

Read original articleLink Icon
A Better Merge Workflow with Jujutsu

This article discusses a new merge workflow using Jujutsu, a modern Version Control System (VCS) tool compatible with Git repositories. The workflow, known as The Austin™ Mega Merge Strategy®, allows for manipulating merge commits efficiently. Jujutsu introduces unique concepts like separate changes and commits, simplifying operations like amending commits. It also features revsets for selecting commits based on properties and eliminates the index by using working copy commits. The article explains creating a new merge commit, adding new parents, rebasing all parents, and the benefits of this workflow, such as testing multiple features together and quick bug fixes. Jujutsu's advanced capabilities in manipulating the commit graph make it stand out compared to Git, ensuring a safe and recoverable merging process. The workflow is particularly useful for managing multiple branches and commits simultaneously, enhancing collaboration and code review processes.

Related

A specification for adding human/machine readable meaning to commit messages

A specification for adding human/machine readable meaning to commit messages

The Conventional Commits specification simplifies commit messages for clarity and automation. It categorizes changes, aids in generating changelogs, and promotes organized development practices without strict case sensitivity requirements.

I kind of like rebasing

I kind of like rebasing

People debate Git workflows, favoring rebasing for a linear history. Redowan Delowar prefers rebasing to consolidate changes and maintain a clean commit history. They discuss interactive rebasing benefits, squashing commits, handling conflicts, and offer practical tips.

Git Workflows for API Technical Writers

Git Workflows for API Technical Writers

Technical writers encounter challenges in maintaining API documentation aligned with evolving designs. Git workflows provide version control and collaboration benefits. Strategies like merging copy improvements, code annotations, and OpenAPI overlays enhance documentation quality. Involving writers in API design ensures user-centric content. Storing docs in separate repositories can resolve Git conflicts.

My .gitconfig File Dissected

My .gitconfig File Dissected

The article delves into .gitconfig file breakdown, covering user details, GPG key signing, Git aliases, and workflow optimization tips. Encourages readers to customize their .gitconfig for enhanced Git usage.

Git: Please Stop Squash Merging

Git: Please Stop Squash Merging

Lucas Seiki Oshiro explains the drawbacks of squash merging in Git, debunking the belief that it condenses changes effectively. He clarifies Git's inner workings and the implications of squash merging.

Link Icon 12 comments
By @dang - 5 months
Related:

GG, a GUI for Jujutsu - https://news.ycombinator.com/item?id=39713896 - March 2024 (2 comments)

jj init – getting serious about replacing Git with Jujutsu - https://news.ycombinator.com/item?id=39232456 - Feb 2024 (110 comments)

Jujutsu: A Git-compatible DVCS that is both simple and powerful - https://news.ycombinator.com/item?id=36952796 - Aug 2023 (261 comments)

Jujutsu: A Git-compatible DVCS that is both simple and powerful - https://news.ycombinator.com/item?id=36371138 - June 2023 (1 comment)

Jujutsu – A Git-compatible DVCS that is both simple and powerful - https://news.ycombinator.com/item?id=30398662 - Feb 2022 (228 comments)

By @aranw - 5 months
I really like the idea of Jujutsu and was really keen to try it out but when I looked at it several months back I found it really hard to get going with it and ended up just ditching it. This article looks to be a explanation to some of the concepts of `jj` and how to use it in a little more depth than some of the other tutorials I have seen out there. Definitely keen to give it another try at some point
By @dolmen - 5 months
I have lot of old local Git branches. Most were pushed on the central server. The central server also have some old branches. Some local branches have been rebased locally. Some have been rebased on the server. Some have been merged on the server (with rebase or not).

I need to clean-up both my local clone and the central server from the branches which contain changes that have been fully merged

Can Jujutsu help with that task? If not, any other solution?

By @technojamin - 5 months
Jujutsu seems really cool, and I love that I can use it in a Git repository alongside other contributors that don't. It seems like a lot of logging features from Git aren't present, though.

Besides the mentioned lack of blame functionality[1], things like path filtering (`git log -- <PATH>`), file-following with rename detection (`git log --follow -- <FILE>`), pickaxe (`git log -S <CODE>`), and range evolution (`git log -L<START>,<END>:<FILE>`) are missing. These tools have all become pretty indispensable to me in my day-to-day work since I've learned them, and I know I can still use them since jj can use Git as a backend, but I don't think I could adopt a tool that doesn't have them as first-class features.

Do any regular users of Jujutsu have thoughts on this?

[1] https://github.com/martinvonz/jj?tab=readme-ov-file#status

By @chasinglogic - 5 months
> Using Jujutsu, “amending a commit” also produces a new commit object, as in Git, but the new commit has the same change ID as the original.

This is confusing to me, though to be fair I'm a "git expert" by trade. If you're amending a commit surely the "change" has changed so the change ID should also change? If the "change" isn't tracking the actual changes then what could it be tracking?

Overall I think this is just more confusing than using git but I think it's cool that people are building alternative clients. That's definitely the way to go if you want adoption.

Making history manipulation easier seems like a bit of a recipe for disaster given my experience training people. That old XKCD about git comes to mind and honestly that's where most people stay, if you bother to learn it then things like Jujitsu are probably harder to use for you. If you aren't interested in learning git to that level then I doubt you want / need something like Jujitsu.

For those curious the "multiple branches" at a time thing they're selling can be done with git, IMO easily, using worktrees: https://git-scm.com/docs/git-worktree

By @xlii - 5 months
I really tried to like jj but I couldn’t make it work for my workflow:

There are files that are committed to repository that I need to edit (e.g. .envrc files, which cannot be overridden). There is no way I can ignore those in Jujutsu.

In plain git I can do sparse checkout using negative paths and it works. jj doesn’t support it, and using positive path doesn’t work as I never know if new files are there.

Every push was a dance around removing my changes. I’m checking if there’s progress from time to time but there’s no so far.

But just yesterday I decided to check git branchless as I’m exploring stacked PR workflow and I can say it’s intriguing and even if more rough around the edges than jj I haven’t yet found any showstoppers.

By @simonmic - 5 months
Are Jujutsu users all using it from the command line ? Is there anything magit-like yet ? Or do you use magit with it ? Have you run into extra complexity and messes because of having two VCSes interacting in one working copy ?
By @OJFord - 5 months
This is essentially GitButler's 'integration branch' idea, but via CLI. I tried it briefly, found it frustrating to use a GUI and not helped by (it's early days) bugs.

It occurred to me I could just do the same 'manually' or with some git aliases to help, but I haven't, and I'm glad I've seen this (and the reminder to try out jj in general) because it's certainly far nearer than it would be in pure git.

By @stevage - 5 months
All these things just remind me how depressing it is that we all use this deeply flawed tool, git, and no one can get enough critical mass for a substantially better version.
By @gocartStatue - 5 months
A better way for suboptimal workflow to begin with („multitasking” on branches)?
By @whoomp12342 - 5 months
the core issue with GIT is this: it requires cognitive overhead. JJ doesn't seem to solve that.