Compare commits
3 Commits
0ec750eb66
...
b2397945f0
| Author | SHA1 | Date | |
|---|---|---|---|
|
b2397945f0
|
|||
|
b86f9bd670
|
|||
|
06eca4b26b
|
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -2304,9 +2304,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8"
|
||||
checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207"
|
||||
dependencies = [
|
||||
"chacha20",
|
||||
"getrandom",
|
||||
|
||||
48
README.md
48
README.md
@@ -24,6 +24,16 @@ jj-cz
|
||||
The tool detects whether you're in a Jujutsu repository, guides you
|
||||
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
|
||||
|
||||
- A Jujutsu repository
|
||||
@@ -41,8 +51,44 @@ what `jj-cz` alone would be good for without `jj`.
|
||||
| 130 | Interrupted |
|
||||
|
||||
## 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 there’s a `flake.nix` file? This means you can run the
|
||||
project using this repository as one of your flakes inputs. In fact,
|
||||
that’s 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
|
||||
cargo install --path .
|
||||
|
||||
7
build.rs
7
build.rs
@@ -2,7 +2,12 @@ use cargo_lock::Lockfile;
|
||||
|
||||
fn main() {
|
||||
let lockfile = Lockfile::load("Cargo.lock").expect("Cargo.lock not found");
|
||||
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());
|
||||
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());
|
||||
println!("cargo:rustc-env=JJ_LIB_VERSION={version}");
|
||||
println!("cargo:rerun-if-changed=Cargo.lock");
|
||||
}
|
||||
|
||||
@@ -239,7 +239,8 @@ impl JjExecutor for JjLib {
|
||||
context: format!("{e:?}"),
|
||||
})?;
|
||||
|
||||
let new_repo = tx.commit("jj-cz: update commit description")
|
||||
let new_repo = tx
|
||||
.commit("jj-cz: update commit description")
|
||||
.await
|
||||
.map_err(|e| Error::JjOperation {
|
||||
context: e.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user