Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for jujutsu version control #1012

Open
Walther opened this issue Dec 31, 2024 · 0 comments
Open

Support for jujutsu version control #1012

Walther opened this issue Dec 31, 2024 · 0 comments
Labels
C-feature request New feature request

Comments

@Walther
Copy link

Walther commented Dec 31, 2024

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 --colocate or with jj 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 every jj command 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 jj and git commands 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-only git commands and use jj to make changes to the repo. One reason for this (see below for more) is that jj commands will usually put the git repo in a "detached HEAD" state, since in jj there 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 a git switch command.

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

  1. detect the presence of a .jj/ directory in addition to .git/
  2. instead of git pull, use jj git fetch or git fetch
@Walther Walther added the C-feature request New feature request label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature request New feature request
Projects
None yet
Development

No branches or pull requests

1 participant