Compare commits

..

2 Commits

Author SHA1 Message Date
0ec750eb66 feat(cli): add jj-lib version to version output
Some checks failed
Publish Docker Images / coverage-and-sonar (push) Failing after 6m2s
2026-04-21 21:02:14 +02:00
c65e493571 feat: set message for multiple revsets
Allows to set the revision message of multiple revisions by passing
them as arguments. This only supports simple revisions, such as `@`,
`@-`, `xs`, and so on. Comple revisions such as `@..@-` are not
supported.

Fixes: #5
2026-04-21 20:50:52 +02:00
4 changed files with 5 additions and 57 deletions

4
Cargo.lock generated
View File

@@ -2304,9 +2304,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.10.1" version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8"
dependencies = [ dependencies = [
"chacha20", "chacha20",
"getrandom", "getrandom",

View File

@@ -24,16 +24,6 @@ jj-cz
The tool detects whether you're in a Jujutsu repository, guides you The tool detects whether you're in a Jujutsu repository, guides you
through the commit message, and applies it to your current change. through the commit message, and applies it to your current change.
You can also set the revision message of a few revisions at once, or
target a single revision other than the current one.
```sh
jj-cz @- xs develop
```
No explicit revision is simply the equivalent of `jj-cz @`, like
`jj desc`.
## Requirements ## Requirements
- A Jujutsu repository - A Jujutsu repository
@@ -51,44 +41,8 @@ what `jj-cz` alone would be good for without `jj`.
| 130 | Interrupted | | 130 | Interrupted |
## Installation ## Installation
### From crates.io
Simply run the following command:
``` You can install jj-cz with Cargo by building it from source.
cargo install jj-cz
```
Done! `jj-cz` is now available!
### With Nix Flakes
Notice how theres a `flake.nix` file? This means you can run the
project using this repository as one of your flakes inputs. In fact,
thats how I install it in my own NixOS configuration! Add this
repository to your configuration:
```nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
jj-cz = {
url = "git+https://labs.phundrak.com/phundrak/jj-cz";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}
```
And tadah! you can now install
`inputs.jj-cz.packages.${pkgs.stdenv.hostPlatform.system}.default`
among your other packages. Take a look at my
[`jujutsu.nix`](https://labs.phundrak.com/phundrak/nix-config/src/branch/main/users/modules/dev/vcs/jujutsu.nix)
module if you need some inspiration.
### From source
You can also install `jj-cz` with Cargo by building it from source.
Just make sure Rust is available on your machine (duh!).
```sh ```sh
cargo install --path . cargo install --path .

View File

@@ -2,12 +2,7 @@ use cargo_lock::Lockfile;
fn main() { fn main() {
let lockfile = Lockfile::load("Cargo.lock").expect("Cargo.lock not found"); let lockfile = Lockfile::load("Cargo.lock").expect("Cargo.lock not found");
let version = lockfile let version = lockfile.packages.iter().find(|p| p.name.as_str() == "jj-lib").map(|p| p.version.to_string()).unwrap_or_else(|| "unknown".to_string());
.packages
.iter()
.find(|p| p.name.as_str() == "jj-lib")
.map(|p| p.version.to_string())
.unwrap_or_else(|| "unknown".to_string());
println!("cargo:rustc-env=JJ_LIB_VERSION={version}"); println!("cargo:rustc-env=JJ_LIB_VERSION={version}");
println!("cargo:rerun-if-changed=Cargo.lock"); println!("cargo:rerun-if-changed=Cargo.lock");
} }

View File

@@ -239,8 +239,7 @@ impl JjExecutor for JjLib {
context: format!("{e:?}"), context: format!("{e:?}"),
})?; })?;
let new_repo = tx let new_repo = tx.commit("jj-cz: update commit description")
.commit("jj-cz: update commit description")
.await .await
.map_err(|e| Error::JjOperation { .map_err(|e| Error::JjOperation {
context: e.to_string(), context: e.to_string(),