Support for jujutsu version control
I want to suggest some general feature
Topgrade should have at least some support for the jujutsu version control system. It is a highly convenient, modern approach to the CLI experience of using a VCS.
More information
Full support for jujutsu specifically might be out of scope or something to consider adding later.
However, jj is git-compatible, and it is a common pattern to interact with git repositories using jj, using the colocation feature:
A "co-located" Jujutsu repo is a hybrid Jujutsu/Git repo. These can be created if you initialize the Jujutsu repo in an existing Git repo by running
jj git init --colocateor withjj git clone --colocate. The Git repo and the Jujutsu repo then share the same working copy. Jujutsu will import and export from and to the Git repo on everyjjcommand automatically.
I am a very happy user of topgrade and its git repositories feature 🧡 However, currently there's a tiny clash with colocated jj-and-git repositories:
It is allowed to mix
jjandgitcommands in such a repo in any order. However, it may be easier to keep track of what is going on if you mostly use read-onlygitcommands and usejjto make changes to the repo. One reason for this (see below for more) is thatjjcommands will usually put thegitrepo in a "detached HEAD" state, since injjthere is not concept of a "currently tracked branch". Before doing mutating Git commands, you may need to tell Git what the current branch should be with agit switchcommand.
Because of the detached HEAD state, topgrade will currently show me errors Failed pulling for any colocated jj-and-git repository I have.
The simplest possible minimal improvement could be to
- detect the presence of a
.jj/directory in addition to.git/ - instead of
git pull, usejj git fetchorgit fetch
Possible inspiration from the Starship shell prompt: https://github.com/starship/starship/issues/5932