diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 14fd229..f171dc7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,17 +22,16 @@ jobs: mkdir mdbook curl -sSL $url | tar -xz --directory=./mdbook echo `pwd`/mdbook >> $GITHUB_PATH - - uses: baptiste0928/cargo-install@v3 - with: - crate: jj-cli - version: "=0.27.0" + - name: Build jj + run: | + cargo build - name: Configure jj run: | - jj config set --user user.name "Steve Klabnik" - jj config set --user user.email "steve@steveklabnik.com" + cargo run --bin jj -- config set --user user.name "Steve Klabnik" + cargo run --bin jj -- config set --user user.email "steve@steveklabnik.com" - name: Build Book run: | - cargo build && PATH=$PATH:target/debug/ mdbook build book + PATH=$PATH:target/debug/ mdbook build book - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58a05b3..6f81a26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,9 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Build jj + run: | + cargo build - name: Configure jj run: | cargo run --bin jj config set --user user.name "Steve Klabnik" diff --git a/.vscode/settings.json b/.vscode/settings.json index 2662de9..c9abec3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,25 @@ { "cSpell.words": [ + "abbb", "DVCS", "hljs", "kozrnusy", + "mdiff", + "mfde", + "mfed", + "mgit", + "mgoodbye", + "mindex", + "mmznvnuw", + "mnmounps", + "mpqvmvrn", + "mquwwlss", + "msrc", + "mtrqnyzv", + "mtrunk", "mtuyzlkn", + "mvnlxpxw", + "mzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", "nmounps", "noreport", "nvnlxpxw", diff --git a/book/src/core-concepts/changes-commits-and-revisions.md b/book/src/core-concepts/changes-commits-and-revisions.md index 2a37eee..19f2935 100644 --- a/book/src/core-concepts/changes-commits-and-revisions.md +++ b/book/src/core-concepts/changes-commits-and-revisions.md @@ -80,7 +80,7 @@ one, it will refuse unless you pass `--ignore-immutable` as an argument. Let's look at `jj log`: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:63:70}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:68:75}} We have the green `@`, but its parent instead has a `○`. This change is mutable. But what about `p`? It has a `◆`. This change is immutable. @@ -103,7 +103,7 @@ to us right now. We can use `jj show` to show information about changes. The root change has a change ID of all `z`s, let's check it out: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:73:81}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:78:84}} Pretty fun. Wait, what's that `Commit ID` doing there? Okay, let's talk about commits. @@ -117,7 +117,7 @@ So we've been talking about how changes are different than `git`'s commits... but `jj` also has commits. Let me explain. Let's use `jj st` to look at our current change: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:83:87}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:88:91}} Do you see how we have four identifiers there? @@ -134,7 +134,7 @@ the contents of the commit, when you create a new git commit, you're also going to get a different ID. Here, let's give it a try: modify `src/main.rs`, in any way that you'd like. Then we'll run `jj st` again: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:92:97}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:99:103}} `o` used to have a commit ID of `95d5c471`, but now it's `c920ae70`. Our change ID remains stable, but the commit ID will change over time. @@ -143,7 +143,7 @@ This is very powerful! Part 4 of the tutorial is titled "Fixing Problems," and a lot of the stuff we will talk about there is powered by commits. We can use `jj evolog`, the "evolution log," to see how a change has evolved over time: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:99:106}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:106:111}} There are a lot of flags to control `jj evolog`'s output. I've chosen the `summary` flag here to show which files we changed. diff --git a/book/src/core-concepts/throwing-away-changes-and-jj-undo.md b/book/src/core-concepts/throwing-away-changes-and-jj-undo.md index 4b3e9b0..aee9760 100644 --- a/book/src/core-concepts/throwing-away-changes-and-jj-undo.md +++ b/book/src/core-concepts/throwing-away-changes-and-jj-undo.md @@ -7,7 +7,7 @@ Getting rid of changes is very easy in `jj`: we can do it with `jj abandon`. If you remember, we're in the middle of some stuff: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:107:112}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:114:118}} If you are coming to this section fresh, just type `jj new` a few times to give yourself some good changes. Done? Great. Let's throw them away. @@ -17,25 +17,25 @@ give yourself some good changes. Done? Great. Let's throw them away. Let's say we don't like that "hello and goodbye world" stuff. We're not going to pursue that further. Getting rid of it is as easy as: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:114:118}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:128:132}} By default, `jj restore` takes changes from your parent change, and puts them into `@`. But there's `--from` and even `--into` flags you can pass as well. Let's grab the diff from our first commit, and apply it to `@`: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:121:125}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:128:132}} As you can see we aren't empty any more. Well, what does our code look like? Let's use `jj diff` to see: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:128:132}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:135:139}} This format is different than `git`'s: we have red and green to indicate what's changed, for example. If you want to get a `git` style diff instead, that is easy as well: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:135:144}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:142:151}} We only had one file that was changed, so we didn't *need* to pass the path to `jj restore`, but `jj restore` is mostly used with individual paths. If we @@ -50,7 +50,7 @@ But what if we want to delete a change entirely? At any time, you can get rid of a change with `jj abandon`. It's tons of fun! Let's try it: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:147:151}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:154:158}} This throws away our current change. We abandoned `opqvmvrn`, and since that was the same as `@`, `jj` makes a new change for us, in this case, called @@ -59,11 +59,11 @@ was the same as `@`, `jj` makes a new change for us, in this case, called But what if we abandon something that's not `@`? Like, let's say, `t`, the change that we're currently on top of. What's the worst that could happen? -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:154:160}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:161:167}} So what happened here? -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:163:169}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:170:175}} As you can see, because we got rid of the commit we were standing on, instead of throwing us away too, `jj` just re-parented us onto the abandoned commit's parent. We're still on @@ -78,11 +78,11 @@ I have good news. There's a really useful subcommand that goes by `jj undo`: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:171:175}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:178:182}} That's it! We're good again: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:178:185}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:185:192}} Everything is back to where we put it. We can always `jj undo` to undo *any* of our last operations, and `jj` will make things right again. @@ -95,7 +95,7 @@ though. What do you think would happen if we `jj undo`'d again right now? Make your guess, and then give it a try: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:188:195}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:195:201}} That's right: the last thing you did was an `undo`, so an `undo` just `undo`es that `undo`. Hilarious, but kind of frustrating. There's a @@ -105,7 +105,7 @@ a bit trickier than it sounds. Regardless, we can fix this: there's no problem with `jj undo` that you can't solve by throwing more `jj undo`s at it: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:197:203}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:204:210}} Whew. That's enough of that. @@ -114,24 +114,24 @@ Whew. That's enough of that. Having an empty change with no description is fine to have if it's `@`, or if it has children. Here's a fun party trick: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:206:210}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:213:217}} That's right: `jj new` can take `--before` or `--after` flags to squish a change in between others. (Yes, we're trying to make squish happen.) And `--no-edit` means that we don't want to move our working copy to the new change: `@` stays right where it is: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:213:222}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:220:229}} So that change is fine. But what if we move away from these changes? Let's make a new change on top of `trunk`: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:225:228}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:232:235}} We had two empty commits on top of `goodbye-world` before, but what about now? -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:230:239}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:238:247}} Our empty change `nvnlxpxw` was discarded, automatically. You don't have to worry about `jj new` littering up your repository, empty changes will end up diff --git a/book/src/getting-started/cloning-a-repository.md b/book/src/getting-started/cloning-a-repository.md index acf49d2..9a18092 100644 --- a/book/src/getting-started/cloning-a-repository.md +++ b/book/src/getting-started/cloning-a-repository.md @@ -12,7 +12,7 @@ of your own. Next, let's clone down our fork. Go to the directory where you'd like to create your clone, in my case, that's `~/src`. And then type this: -```bash +```nohighlight $ jj git clone --colocate git@github.com:/hello-world Fetching into new repo in "/home//src/hello-world" bookmark: trunk@origin [new] untracked @@ -30,7 +30,7 @@ command, `--colocate`. `jj` supports two different kinds of repositories: colocated, and non-colocated. What's the difference? Well, let's take a look at our repository: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:12:19}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:15:22}} We have both a `.jj` and a `.git` directory at the top level. This means both jj's information as git's information are co-located: they're next to each @@ -44,7 +44,7 @@ at the root of the repository will still work. Let's see what our repository's history looks like: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:22:27}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:26:31}} This looks a bit different than `git log`, but it's the same general idea: we can see where we our in our history. diff --git a/book/src/getting-started/interacting-with-github.md b/book/src/getting-started/interacting-with-github.md index 124643a..16283a0 100644 --- a/book/src/getting-started/interacting-with-github.md +++ b/book/src/getting-started/interacting-with-github.md @@ -8,7 +8,7 @@ would make it harder to understand. Let's look at that `jj log` output again: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:49:56}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:54:61}} Do you see that little `trunk` over on the right there? That is a *bookmark* in `jj`, and it's how `jj` understands git branches. `trunk` is the name of @@ -24,7 +24,7 @@ locally, but when we interact with GitHub, it needs a branch name. To create a bookmark, we can use `jj bookmark`: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:59:61}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:64:65}} `jj bookmark create` takes a name for the bookmark, and then we also pass a `-r` flag. This is short for "revision," which is a sort of catch-all name for the various kinds @@ -33,7 +33,7 @@ the change ID. In this case, we pass `@-`, which means "the parent of `@`." Let's look at our log: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:63:70}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:68:75}} We can now see `goodbye-world` listed on the right. Great! Let's push that up to GitHub. But before we do, a warning: diff --git a/book/src/getting-started/making-a-new-change.md b/book/src/getting-started/making-a-new-change.md index 2f31717..ba93634 100644 --- a/book/src/getting-started/making-a-new-change.md +++ b/book/src/getting-started/making-a-new-change.md @@ -7,7 +7,7 @@ simplest possible workflow. If you're a fan of building up small commits via the If you remember from the end of the last section, we're on an empty change. You can double check with `jj status` (or `jj st`): -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:29:32}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:34:37}} So what is a change, anyway? It is the core primitive you'll be working with in `jj`. We'll talk about that actually means in Part 2. For now, you can think of @@ -35,7 +35,7 @@ fn main() { A bit fatalistic, but it works. Let's run `jj st` again: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:37:42}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:42:46}} We can see we've modified `src/main.rs`. Whenever we run a `jj` command, `jj` will snapshot all of the changes that we've made to any files in our repository @@ -51,14 +51,14 @@ but now I love it. Let's say we're happy with the contents of this change. We're done, and we want to start working on something else. To do that, we can use `jj commit`: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:44:46}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:49:51}} Easy enough! Our working copy is now on a fresh new change, and its parent is our "Goodbye, world!" change that we just committed. To see our changes in context, let's look at `jj log` again: -{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:49:56}} +{{#trycmdinclude tests/tests/cmd/getting-started.trycmd:54:61}} You can see that we're currently working on an empty change. It has `x` as a change ID, but there's also a little `@` there: `@` is an alias for the working diff --git a/mdbook-trycmd/src/main.rs b/mdbook-trycmd/src/main.rs index acc7e45..993fba8 100644 --- a/mdbook-trycmd/src/main.rs +++ b/mdbook-trycmd/src/main.rs @@ -1,16 +1,9 @@ -use std::collections::HashMap; -use std::fs; use std::io; -use std::process::Command; -use std::process::Stdio; -use std::sync::LazyLock; -use std::sync::Mutex; use mdbook::errors::Result; use mdbook::preprocess::CmdPreprocessor; use mdbook::BookItem; use regex::Regex; -use tempfile::TempDir; fn main() -> Result<()> { let mut args = std::env::args().skip(1); @@ -31,7 +24,7 @@ fn main() -> Result<()> { let BookItem::Chapter(chapter) = item else { return; }; - match run_examples(&chapter.content) { + match insert_trycmd_output(&chapter.content) { Ok(new_content) => chapter.content = new_content, Err(e) => eprintln!("could not process chapter: {e}"), } @@ -42,102 +35,7 @@ fn main() -> Result<()> { Ok(()) } -struct Cache { - inner: LazyLock>>, -} - -static CACHE: Cache = Cache { - inner: LazyLock::new(|| Mutex::new(HashMap::new())), -}; - -impl Cache { - fn render(&self, key: &str) -> String { - let mut map = self.inner.lock().unwrap(); - - map.entry(key.to_string()) - .or_insert_with(|| { - let contents = fs::read_to_string(key).unwrap(); - let contents: String = contents - .lines() - .filter(|line| line.starts_with("$ ")) - .collect::>() - .join("\n"); - - let mut rendered = String::new(); - - let dir = TempDir::new().unwrap(); - - for command in contents.lines() { - // getting real hard-coded with it. we want to set this to never for - // reproducibility in trycmd, but we also want it to be on here because - // that's the whole dang point! - let command = if command == "$ jj config set --repo ui.color never" { - " jj config set --repo ui.color always" - } else { - command.strip_prefix('$').unwrap() - }; - - eprintln!("about to run {command}"); - - let output = Command::new("bash") - .current_dir(&dir) - .arg("-c") - .arg(command) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .output() - .unwrap(); - - let render = |s| { - let input = String::from_utf8(s).unwrap(); - let input = replace_colors(input); - ansi_to_html::Converter::new() - .four_bit_var_prefix(Some("jj-".to_string())) - .convert(&input) - }; - - let stdout = render(output.stdout).expect("stdout failed to render"); - let stderr = render(output.stderr).expect("stderr failed to render"); - - rendered.push('$'); - rendered.push_str(command); - rendered.push('\n'); - rendered.push_str(&stdout); - rendered.push_str(&stderr); - if !stdout.is_empty() || !stderr.is_empty() { - rendered.push('\n'); - } - } - - rendered - }) - .to_string() - } -} - -fn replace_colors(input: String) -> String { - let re = Regex::new(r"\x1b\[38;5;([0-9]+)m").unwrap(); - - re.replace_all(&input, |caps: ®ex::Captures| { - if let Ok(num) = caps[1].parse::() { - let replacement = match num { - 0..=7 => 30 + num, // Standard foreground colors - 8..=15 => 90 + (num - 8), // Bright foreground colors - code => { - eprintln!("non-16 color found: {code}"); - return caps[0].to_string(); // Keep unchanged if out of - // range - } - }; - format!("\x1b[{}m", replacement) - } else { - caps[0].to_string() - } - }) - .to_string() -} - -fn run_examples(content: &str) -> Result { +fn insert_trycmd_output(content: &str) -> Result { let mut buf = content.to_string(); let regex = Regex::new(r#"\{\{#trycmdinclude ([\w\/.\-]+):(\d+)(?::(\d+))?\}\}"#).unwrap(); @@ -148,15 +46,21 @@ fn run_examples(content: &str) -> Result { let path = cap.get(1).unwrap(); - Match { - contents: CACHE.render(path.as_str()), + let contents = std::fs::read_to_string(path.as_str())?; + let contents = replace_colors(contents); + let contents = ansi_to_html::Converter::new() + .four_bit_var_prefix(Some("jj-".to_string())) + .convert(&contents)?; + + Ok(Match { + contents, pos_start: m.start(), pos_end: m.end(), start: cap.get(2).map(|c| c.as_str().parse().unwrap()), end: cap.get(3).map(|c| c.as_str().parse().unwrap()), - } + }) }) - .collect(); + .collect::>>()?; replace_matches(&mut buf, &mut matches)?; @@ -210,3 +114,26 @@ fn replace_matches(input: &mut String, matches: &mut Vec) -> io::Result<( Ok(()) } + +/// replace 256 color output with 16 color output +fn replace_colors(input: String) -> String { + let re = Regex::new(r"\x1b\[38;5;([0-9]+)m").unwrap(); + + re.replace_all(&input, |caps: ®ex::Captures| { + if let Ok(num) = caps[1].parse::() { + let replacement = match num { + 0..=7 => 30 + num, // Standard foreground colors + 8..=15 => 90 + (num - 8), // Bright foreground colors + code => { + eprintln!("non-16 color found: {code}"); + return caps[0].to_string(); // Keep unchanged if out of + // range + } + }; + format!("\x1b[{}m", replacement) + } else { + caps[0].to_string() + } + }) + .to_string() +} diff --git a/tests/tests/cmd/getting-started.trycmd b/tests/tests/cmd/getting-started.trycmd index 2e877dc..9193687 100644 --- a/tests/tests/cmd/getting-started.trycmd +++ b/tests/tests/cmd/getting-started.trycmd @@ -7,7 +7,7 @@ Working copy now at: tnmounps 4fed3b0d (empty) (no description set) Parent commit : ptrqnyzv 0c72abbb trunk | Hello, world! Added 4 files, modified 0 files, removed 0 files -$ jj config set --repo ui.color never +$ jj config set --repo ui.color always $ jj config set --repo debug.commit-timestamp "2025-02-05T22:43:34+00:00" $ jj config set --repo debug.op-timestamp "2025-02-05T22:43:34+00:00" @@ -24,71 +24,71 @@ $ tree . -a -L 1 --noreport $ jj config set --repo debug.randomness-seed 12347 $ jj log -@ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 4fed3b0d -│ (empty) (no description set) -◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk git_head() 0c72abbb +@ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 4fed3b0d +│ (empty) (no description set) +◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk git_head() 0c72abbb │ Hello, world! ~ $ jj config set --repo debug.randomness-seed 12348 $ jj status The working copy has no changes. -Working copy : tnmounps 4fed3b0d (empty) (no description set) -Parent commit: ptrqnyzv 0c72abbb trunk | Hello, world! +Working copy : tnmounps 4fed3b0d (empty) (no description set) +Parent commit: ptrqnyzv 0c72abbb trunk | Hello, world! $ sed -i 's/Hello/Goodbye/' src/main.rs $ jj config set --repo debug.randomness-seed 12349 $ jj st Working copy changes: -M src/main.rs -Working copy : tnmounps 729bb51c (no description set) -Parent commit: ptrqnyzv 0c72abbb trunk | Hello, world! +M src/main.rs +Working copy : tnmounps 729bb51c (no description set) +Parent commit: ptrqnyzv 0c72abbb trunk | Hello, world! $ jj config set --repo debug.randomness-seed 12350 $ jj commit -m "Goodbye, world!" -Working copy now at: opqvmvrn 95d5c471 (empty) (no description set) -Parent commit : tnmounps 326253c2 Goodbye, world! +Working copy now at: opqvmvrn 95d5c471 (empty) (no description set) +Parent commit : tnmounps 326253c2 Goodbye, world! $ jj config set --repo debug.randomness-seed 12351 $ jj log -@ opqvmvrn steve@steveklabnik.com 2025-02-06 09:43:34 95d5c471 -│ (empty) (no description set) -○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 git_head() 326253c2 +@ opqvmvrn steve@steveklabnik.com 2025-02-06 09:43:34 95d5c471 +│ (empty) (no description set) +○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 git_head() 326253c2 │ Goodbye, world! -◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk 0c72abbb +◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk 0c72abbb │ Hello, world! ~ $ jj config set --repo debug.randomness-seed 12352 $ jj bookmark create goodbye-world -r @- -Created 1 bookmarks pointing to tnmounps 326253c2 goodbye-world | Goodbye, world! +Created 1 bookmarks pointing to tnmounps 326253c2 goodbye-world | Goodbye, world! $ jj config set --repo debug.randomness-seed 12353 $ jj log -@ opqvmvrn steve@steveklabnik.com 2025-02-06 09:43:34 95d5c471 -│ (empty) (no description set) -○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 goodbye-world git_head() 326253c2 +@ opqvmvrn steve@steveklabnik.com 2025-02-06 09:43:34 95d5c471 +│ (empty) (no description set) +○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 goodbye-world git_head() 326253c2 │ Goodbye, world! -◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk 0c72abbb +◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk 0c72abbb │ Hello, world! ~ $ jj config set --repo debug.randomness-seed 12354 $ jj show zz -Commit ID: 0000000000000000000000000000000000000000 -Change ID: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz -Author : (no name set) <(no email set)> (1970-01-01 11:00:00) -Committer: (no name set) <(no email set)> (1970-01-01 11:00:00) +Commit ID: 0000000000000000000000000000000000000000 +Change ID: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +Author : (no name set) <(no email set)> (1970-01-01 11:00:00) +Committer: (no name set) <(no email set)> (1970-01-01 11:00:00) - (no description set) + (no description set) $ jj config set --repo debug.randomness-seed 12355 $ jj st The working copy has no changes. -Working copy : opqvmvrn 95d5c471 (empty) (no description set) -Parent commit: tnmounps 326253c2 goodbye-world | Goodbye, world! +Working copy : opqvmvrn 95d5c471 (empty) (no description set) +Parent commit: tnmounps 326253c2 goodbye-world | Goodbye, world! $ jj config set --repo debug.randomness-seed 12356 @@ -98,150 +98,151 @@ $ sed -i 's/Goodbye/Hello/' src/main.rs $ jj config set --repo debug.randomness-seed 12357 $ jj st Working copy changes: -M src/main.rs -Working copy : opqvmvrn c920ae70 (no description set) -Parent commit: tnmounps 326253c2 goodbye-world | Goodbye, world! +M src/main.rs +Working copy : opqvmvrn c920ae70 (no description set) +Parent commit: tnmounps 326253c2 goodbye-world | Goodbye, world! $ jj config set --repo debug.randomness-seed 12358 $ jj evolog --summary -@ opqvmvrn steve@steveklabnik.com 2025-02-06 09:43:34 c920ae70 -│ (no description set) -│ M src/main.rs -○ opqvmvrn hidden steve@steveklabnik.com 2025-02-06 09:43:34 95d5c471 - (empty) (no description set) +@ opqvmvrn steve@steveklabnik.com 2025-02-06 09:43:34 c920ae70 +│ (no description set) +│ M src/main.rs +○ opqvmvrn hidden steve@steveklabnik.com 2025-02-06 09:43:34 95d5c471 + (empty) (no description set) $ jj config set --repo debug.randomness-seed 12359 $ jj st Working copy changes: -M src/main.rs -Working copy : opqvmvrn c920ae70 (no description set) -Parent commit: tnmounps 326253c2 goodbye-world | Goodbye, world! +M src/main.rs +Working copy : opqvmvrn c920ae70 (no description set) +Parent commit: tnmounps 326253c2 goodbye-world | Goodbye, world! $ jj config set --repo debug.randomness-seed 12360 $ jj restore src/main.rs -Created opqvmvrn acb427ce (empty) (no description set) -Working copy now at: opqvmvrn acb427ce (empty) (no description set) -Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! +Created opqvmvrn acb427ce (empty) (no description set) +Working copy now at: opqvmvrn acb427ce (empty) (no description set) +Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! Added 0 files, modified 1 files, removed 0 files $ jj config set --repo debug.randomness-seed 12361 $ jj restore --from p src/main.rs -Created opqvmvrn b37efa21 (no description set) -Working copy now at: opqvmvrn b37efa21 (no description set) -Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! +Created opqvmvrn b37efa21 (no description set) +Working copy now at: opqvmvrn b37efa21 (no description set) +Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! Added 0 files, modified 1 files, removed 0 files $ jj config set --repo debug.randomness-seed 12362 $ jj diff -Modified regular file src/main.rs: - 1 1: fn main() { - 2 2: println!("GoodbyeHello, world!"); - 3 3: } +Modified regular file src/main.rs: + 1  1: fn main() { + 2  2: println!("GoodbyeHello, world!"); + 3  3: } $ jj config set --repo debug.randomness-seed 12363 $ jj diff --git -diff --git a/src/main.rs b/src/main.rs -index 865c8c8225..e7a11a969c 100644 ---- a/src/main.rs -+++ b/src/main.rs -@@ -1,3 +1,3 @@ +diff --git a/src/main.rs b/src/main.rs +index 865c8c8225..e7a11a969c 100644 +--- a/src/main.rs ++++ b/src/main.rs +@@ -1,3 +1,3 @@ fn main() { -- println!("Goodbye, world!"); -+ println!("Hello, world!"); +- println!("Goodbye, world!"); ++ println!("Hello, world!"); } $ jj config set --repo debug.randomness-seed 12364 $ jj abandon -Abandoned commit opqvmvrn b37efa21 (no description set) -Working copy now at: nvnlxpxw 0d1ce6d4 (empty) (no description set) -Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! +Abandoned commit opqvmvrn b37efa21 (no description set) +Working copy now at: nvnlxpxw 0d1ce6d4 (empty) (no description set) +Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! Added 0 files, modified 1 files, removed 0 files $ jj config set --repo debug.randomness-seed 12365 $ jj abandon -r t -Abandoned commit tnmounps 326253c2 goodbye-world | Goodbye, world! +Abandoned commit tnmounps 326253c2 goodbye-world | Goodbye, world! Deleted bookmarks: goodbye-world Rebased 1 descendant commits onto parents of abandoned commits -Working copy now at: nvnlxpxw dfde4351 (empty) (no description set) -Parent commit : ptrqnyzv 0c72abbb trunk | Hello, world! +Working copy now at: nvnlxpxw dfde4351 (empty) (no description set) +Parent commit : ptrqnyzv 0c72abbb trunk | Hello, world! Added 0 files, modified 1 files, removed 0 files $ jj config set --repo debug.randomness-seed 12366 $ jj log -@ nvnlxpxw steve@steveklabnik.com 2025-02-06 09:43:33 dfde4351 -│ (empty) (no description set) -◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk git_head() 0c72abbb +@ nvnlxpxw steve@steveklabnik.com 2025-02-06 09:43:33 dfde4351 +│ (empty) (no description set) +◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk git_head() 0c72abbb │ Hello, world! ~ $ jj config set --repo debug.randomness-seed 12367 $ jj undo -Undid operation: 57a0967c9ede (2025-02-06 09:43:34) abandon commit 326253c27c9867c92d11422133a39b67fdcb602f -Working copy now at: nvnlxpxw 0d1ce6d4 (empty) (no description set) -Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! +Undid operation: 57a0967c9ede (2025-02-06 09:43:34) abandon commit 326253c27c9867c92d11422133a39b67fdcb602f +Working copy now at: nvnlxpxw 0d1ce6d4 (empty) (no description set) +Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! Added 0 files, modified 1 files, removed 0 files $ jj config set --repo debug.randomness-seed 12368 $ jj log -@ nvnlxpxw steve@steveklabnik.com 2025-02-06 09:43:32 0d1ce6d4 -│ (empty) (no description set) -○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 goodbye-world git_head() 326253c2 +@ nvnlxpxw steve@steveklabnik.com 2025-02-06 09:43:32 0d1ce6d4 +│ (empty) (no description set) +○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 goodbye-world git_head() 326253c2 │ Goodbye, world! -◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk 0c72abbb +◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk 0c72abbb │ Hello, world! ~ $ jj config set --repo debug.randomness-seed 12369 $ jj undo -Undid operation: f4d229f0501c (2025-02-06 09:43:34) undo operation 57a0967c9ede1d9ea8a06f733fddf8cf6bcd632857444936fc8f1b2d17bfdb8e1e525cc3baa3264afb92adb480499cc23fde7348ca51fc8807081462071fe211 -Working copy now at: nvnlxpxw dfde4351 (empty) (no description set) -Parent commit : ptrqnyzv 0c72abbb trunk | Hello, world! +Undid operation: f4d229f0501c (2025-02-06 09:43:34) undo operation 57a0967c9ede1d9ea8a06f733fddf8cf6bcd632857444936fc8f1b2d17bfdb8e1e525cc3baa3264afb92adb480499cc23fde7348ca51fc8807081462071fe211 +Working copy now at: nvnlxpxw dfde4351 (empty) (no description set) +Parent commit : ptrqnyzv 0c72abbb trunk | Hello, world! Added 0 files, modified 1 files, removed 0 files -Hint: This action reverted an 'undo' operation. The repository is now in the same state as it was before the original 'undo'. -Hint: If your goal is to undo multiple operations, consider using `jj op log` to see past states, and `jj op restore` to restore one of these states. +Hint: This action reverted an 'undo' operation. The repository is now in the same state as it was before the original 'undo'. +Hint: If your goal is to undo multiple operations, consider using `jj op log` to see past states, and `jj op restore` to restore one of these states. $ jj config set --repo debug.randomness-seed 12370 $ jj undo -Undid operation: 588ca5b61206 (2025-02-06 09:43:34) undo operation f4d229f0501caf00432edafeacfbc0f733188ff7ba910e490dd091dc5fed7a3d9bbb2bb6227c41cb7bc518452753cdfccb97546752058495e223f51b6c7c352e -Working copy now at: nvnlxpxw 0d1ce6d4 (empty) (no description set) -Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! +Undid operation: 588ca5b61206 (2025-02-06 09:43:34) undo operation f4d229f0501caf00432edafeacfbc0f733188ff7ba910e490dd091dc5fed7a3d9bbb2bb6227c41cb7bc518452753cdfccb97546752058495e223f51b6c7c352e +Working copy now at: nvnlxpxw 0d1ce6d4 (empty) (no description set) +Parent commit : tnmounps 326253c2 goodbye-world | Goodbye, world! Added 0 files, modified 1 files, removed 0 files -Hint: This action reverted an 'undo' operation. The repository is now in the same state as it was before the original 'undo'. -Hint: If your goal is to undo multiple operations, consider using `jj op log` to see past states, and `jj op restore` to restore one of these states. +Hint: This action reverted an 'undo' operation. The repository is now in the same state as it was before the original 'undo'. +Hint: If your goal is to undo multiple operations, consider using `jj op log` to see past states, and `jj op restore` to restore one of these states. $ jj config set --repo debug.randomness-seed 12371 $ jj new --before n --no-edit -Created new commit wmznvnuw 24fb2f9f (empty) (no description set) +Created new commit wmznvnuw 24fb2f9f (empty) (no description set) Rebased 1 descendant commits -Working copy now at: nvnlxpxw 6ac2036e (empty) (no description set) -Parent commit : wmznvnuw 24fb2f9f (empty) (no description set) +Working copy now at: nvnlxpxw 6ac2036e (empty) (no description set) +Parent commit : wmznvnuw 24fb2f9f (empty) (no description set) $ jj config set --repo debug.randomness-seed 12371 $ jj log -@ nvnlxpxw steve@steveklabnik.com 2025-02-06 09:43:34 6ac2036e -│ (empty) (no description set) -○ wmznvnuw steve@steveklabnik.com 2025-02-06 09:43:31 git_head() 24fb2f9f -│ (empty) (no description set) -○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 goodbye-world 326253c2 +@ nvnlxpxw steve@steveklabnik.com 2025-02-06 09:43:34 6ac2036e +│ (empty) (no description set) +○ wmznvnuw steve@steveklabnik.com 2025-02-06 09:43:31 git_head() 24fb2f9f +│ (empty) (no description set) +○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 goodbye-world 326253c2 │ Goodbye, world! -◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk 0c72abbb +◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk 0c72abbb │ Hello, world! ~ $ jj config set --repo debug.randomness-seed 12372 $ jj new trunk -Working copy now at: oquwwlss 09f65a23 (empty) (no description set) -Parent commit : ptrqnyzv 0c72abbb trunk | Hello, world! +Working copy now at: oquwwlss 09f65a23 (empty) (no description set) +Parent commit : ptrqnyzv 0c72abbb trunk | Hello, world! Added 0 files, modified 1 files, removed 0 files +$ jj config set --repo debug.randomness-seed 12373 $ jj log -@ oquwwlss steve@steveklabnik.com 2025-02-06 09:43:32 09f65a23 -│ (empty) (no description set) -│ ○ wmznvnuw steve@steveklabnik.com 2025-02-06 09:43:31 24fb2f9f -│ │ (empty) (no description set) -│ ○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 goodbye-world 326253c2 +@ oquwwlss steve@steveklabnik.com 2025-02-06 09:43:32 09f65a23 +│ (empty) (no description set) +│ ○ wmznvnuw steve@steveklabnik.com 2025-02-06 09:43:31 24fb2f9f +│ │ (empty) (no description set) +│ ○ tnmounps steve@steveklabnik.com 2025-02-06 09:43:34 goodbye-world 326253c2 ├─╯ Goodbye, world! -◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk git_head() 0c72abbb +◆ ptrqnyzv steve@steveklabnik.com 2024-09-24 12:43:36 trunk git_head() 0c72abbb │ Hello, world! ~