mirror of
https://github.com/martinvonz/jj.git
synced 2024-09-11 05:45:30 +03:00
cli: clarify "Now at: <commit>" message as "Working copy now at: <commit>"
I considered even changing the message to "Checking out: <commit>" as that's technically more correct (the message is printed when the view's checkout is updated, i.e. before the working copy is updated). However, I worried that users would find it confusing that e.g. `jj close` would result in a "Checking out: " message, even though that's what actually happens.
This commit is contained in:
parent
83c460449b
commit
38a3462d4e
36
README.md
36
README.md
@ -121,7 +121,7 @@ Let's check out a different commit so we get some files to work with in the
|
||||
working copy:
|
||||
```shell script
|
||||
$ jj co 080a9b37ff7e
|
||||
Now at: 608c179a60df
|
||||
Working copy now at: 608c179a60df
|
||||
added 84 files, modified 0 files, removed 0 files
|
||||
$ jj st
|
||||
Parent commit: 080a9b37ff7e cli: make `jj st` show parent commit before working copy commit
|
||||
@ -146,7 +146,7 @@ working on:
|
||||
# This will bring up $EDITOR (or `pico` by default). Enter something like
|
||||
# "Jujutsu is ready!" in the editor and then close it.
|
||||
$ jj describe
|
||||
Now at: b2985d68096d Jujutsu is ready!
|
||||
Working copy now at: b2985d68096d Jujutsu is ready!
|
||||
```
|
||||
|
||||
Now make the change in the README:
|
||||
@ -198,7 +198,7 @@ this. We'll get back to that when we talk about conflicts.)
|
||||
So, let's say we're now done with this commit, so we close it:
|
||||
```shell script
|
||||
$ jj close
|
||||
Now at: 192b456b024b
|
||||
Working copy now at: 192b456b024b
|
||||
$ jj st
|
||||
Parent commit: fb563a4c6d26 Jujutsu is ready!
|
||||
Working copy : 192b456b024b
|
||||
@ -282,18 +282,18 @@ commits:
|
||||
```shell script
|
||||
# Check out the grandparent of the working copy
|
||||
$ jj co ::@
|
||||
Now at: 9164f1d6a011
|
||||
Working copy now at: 9164f1d6a011
|
||||
added 0 files, modified 1 files, removed 0 files
|
||||
$ echo a > file1; jj close -m A
|
||||
Now at: 5be91b2b5b69
|
||||
Working copy now at: 5be91b2b5b69
|
||||
$ echo b1 > file1; jj close -m B1
|
||||
Now at: a0331f1eeece
|
||||
Working copy now at: a0331f1eeece
|
||||
$ echo b2 > file1; jj close -m B2
|
||||
Now at: fd571967346e
|
||||
Working copy now at: fd571967346e
|
||||
$ echo c > file2; jj close -m C
|
||||
Now at: 4ae1e0587eef
|
||||
Working copy now at: 4ae1e0587eef
|
||||
$ jj co ::::@
|
||||
Now at: 9195b6d2e8dc
|
||||
Working copy now at: 9195b6d2e8dc
|
||||
added 0 files, modified 1 files, removed 1 files
|
||||
$ jj l
|
||||
o <-- 9195b6d2e8dc 47684978bf4b martinvonz@google.com 2021-05-26 12:39:56.000 -07:00
|
||||
@ -342,7 +342,7 @@ resolved the conflict, we'll squash the conflict resolution into the conflicted
|
||||
B2. That might look like this:
|
||||
```shell script
|
||||
$ jj co 0c305a9e6b27 # Replace the hash by what you have for B2
|
||||
Now at: 619f58d8a988
|
||||
Working copy now at: 619f58d8a988
|
||||
added 0 files, modified 1 files, removed 0 files
|
||||
$ cat file1
|
||||
<<<<<<<
|
||||
@ -355,7 +355,7 @@ b2
|
||||
$ echo resolved > file1
|
||||
$ jj squash
|
||||
Rebased 1 descendant commits
|
||||
Now at: e659edc4a9fc
|
||||
Working copy now at: e659edc4a9fc
|
||||
$ jj l
|
||||
o <-- e659edc4a9fc 461f38324592 martinvonz@google.com 2021-05-26 12:53:08.000 -07:00
|
||||
|
|
||||
@ -401,7 +401,7 @@ The most useful command is `jj op undo`, which will undo an operation. By
|
||||
default, it will undo the most recent operation. Let's try it:
|
||||
```shell script
|
||||
$ jj op undo
|
||||
Now at: 41f0d2289b56
|
||||
Working copy now at: 41f0d2289b56
|
||||
$ jj l
|
||||
o <-- 41f0d2289b56 b1e3a4afde5e martinvonz@google.com 2021-05-26 12:52:39.000 -07:00
|
||||
|
|
||||
@ -431,14 +431,14 @@ commits. These commands require you to have `meld` installed for now
|
||||
content to test these commands, so let's create a few more commits:
|
||||
```shell script
|
||||
$ jj co origin/main
|
||||
Now at: 61b0efa09dbe
|
||||
Working copy now at: 61b0efa09dbe
|
||||
added 0 files, modified 0 files, removed 1 files
|
||||
$ printf 'a\nb\nc\n' > file; jj close -m abc
|
||||
Now at: f9147a088c0d
|
||||
Working copy now at: f9147a088c0d
|
||||
$ printf 'A\nB\nc\n' > file; jj close -m ABC
|
||||
Now at: 9d97c5018b23
|
||||
Working copy now at: 9d97c5018b23
|
||||
$ printf 'A\nB\nC\nD\n' > file; jj close -m ABCD
|
||||
Now at: c5a985bc3f41
|
||||
Working copy now at: c5a985bc3f41
|
||||
$ jj l
|
||||
o <-- c5a985bc3f41 3568f6e332d5 martinvonz@google.com 2021-05-26 14:36:46.000 -07:00
|
||||
|
|
||||
@ -460,7 +460,7 @@ Now try that:
|
||||
```shell script
|
||||
$ jj squash -i -r :@
|
||||
Rebased 1 descendant commits
|
||||
Now at: 4b4c714b36aa
|
||||
Working copy now at: 4b4c714b36aa
|
||||
```
|
||||
That will bring up Meld with a diff of the changes in the "ABCD" commit. Modify
|
||||
the right side of the diff to have the desired end state in "ABC" by removing
|
||||
@ -486,7 +486,7 @@ checking it out.
|
||||
$ jj edit -r ::@
|
||||
Created 2423c134ea70 ABC
|
||||
Rebased 2 descendant commits
|
||||
Now at: d31c52e8ca41
|
||||
Working copy now at: d31c52e8ca41
|
||||
```
|
||||
When Meld starts, edit the right side by e.g. adding something to the first
|
||||
line. Then close Meld. You can now inspect the rewritten commit with
|
||||
|
@ -506,7 +506,7 @@ fn update_working_copy(
|
||||
err
|
||||
))
|
||||
})?;
|
||||
ui.write("Now at: ")?;
|
||||
ui.write("Working copy now at: ")?;
|
||||
ui.write_commit_summary(repo.as_repo_ref(), &new_commit)?;
|
||||
ui.write("\n")?;
|
||||
Ok(Some(stats))
|
||||
|
@ -90,7 +90,7 @@ fn smoke_test() {
|
||||
testutils::CommandRunner::new(&repo_path).run(vec!["describe", "-m", "add some files"]);
|
||||
assert_eq!(output.status, 0);
|
||||
let stdout_string = output.stdout_string();
|
||||
let output_regex = Regex::new("^Now at: [[:xdigit:]]+ add some files\n$").unwrap();
|
||||
let output_regex = Regex::new("^Working copy now at: [[:xdigit:]]+ add some files\n$").unwrap();
|
||||
assert!(
|
||||
output_regex.is_match(&stdout_string),
|
||||
"output was: {}",
|
||||
@ -101,7 +101,7 @@ fn smoke_test() {
|
||||
let output = testutils::CommandRunner::new(&repo_path).run(vec!["close"]);
|
||||
assert_eq!(output.status, 0);
|
||||
let stdout_string = output.stdout_string();
|
||||
let output_regex = Regex::new("^Now at: [[:xdigit:]]+ \n$").unwrap();
|
||||
let output_regex = Regex::new("^Working copy now at: [[:xdigit:]]+ \n$").unwrap();
|
||||
assert!(
|
||||
output_regex.is_match(&stdout_string),
|
||||
"output was: {}",
|
||||
|
Loading…
Reference in New Issue
Block a user