-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git_backend: add a README to conflicted commits
When you use e.g. `git switch` to check out a conflicted commit, you're going to end up with the `.jjconflicts-*` directories in your working copy. It's probably not obvious what those mean. This patch adds a README file to the root tree to try to explain to users what's going on and how to recover. The authoritative information about conflicts is stored in the `jj:trees` commit header. The contents of conflicted commits is only used for preventing GC. We can therefore add contents to the tree without much consequence.
- Loading branch information
1 parent
e14ee8b
commit 2f4a553
Showing
12 changed files
with
118 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,7 +116,7 @@ fn test_rewrite_immutable_commands() { | |
insta::assert_snapshot!(stdout, @r###" | ||
@ yqosqzyt [email protected] 2001-02-03 08:05:13 3f89addf | ||
│ (empty) (no description set) | ||
│ ◉ mzvwutvl [email protected] 2001-02-03 08:05:11 main 3d14df18 conflict | ||
│ ◉ mzvwutvl [email protected] 2001-02-03 08:05:11 main 406c181c conflict | ||
╭─┤ (empty) merge | ||
│ │ | ||
│ ~ | ||
|
@@ -129,71 +129,71 @@ fn test_rewrite_immutable_commands() { | |
// abandon | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["abandon", "main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// chmod | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["chmod", "-r=main", "x", "file"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// describe | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["describe", "main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// diffedit | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["diffedit", "-r=main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// edit | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["edit", "main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// move --from | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["move", "--from=main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Warning: `jj move` is deprecated; use `jj squash` instead, which is equivalent | ||
Warning: `jj move` will be removed in a future version, and this will be a hard error | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// move --to | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["move", "--to=main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Warning: `jj move` is deprecated; use `jj squash` instead, which is equivalent | ||
Warning: `jj move` will be removed in a future version, and this will be a hard error | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// new --insert-before | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["new", "--insert-before", "main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// new --insert-after parent_of_main | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["new", "--insert-after", "description(b)"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// parallelize | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["parallelize", "description(b)", "main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// rebase -s | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["rebase", "-s=main", "-d=@"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// rebase -b | ||
|
@@ -205,31 +205,31 @@ fn test_rewrite_immutable_commands() { | |
// rebase -r | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["rebase", "-r=main", "-d=@"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// resolve | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["resolve", "-r=description(merge)", "file"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// restore -c | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["restore", "-c=main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// restore --to | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["restore", "--to=main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// split | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["split", "-r=main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
// squash | ||
|
@@ -241,7 +241,7 @@ fn test_rewrite_immutable_commands() { | |
// unsquash | ||
let stderr = test_env.jj_cmd_failure(&repo_path, &["unsquash", "-r=main"]); | ||
insta::assert_snapshot!(stderr, @r###" | ||
Error: Commit 3d14df18607e is immutable | ||
Error: Commit 406c181c04d8 is immutable | ||
Hint: Configure the set of immutable commits via `revset-aliases.immutable_heads()`. | ||
"###); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ fn test_obslog_with_or_without_diff() { | |
insta::assert_snapshot!(stdout, @r###" | ||
@ rlvkpnrz [email protected] 2001-02-03 08:05:10 66b42ad3 | ||
│ my description | ||
◉ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 ebc23d4b conflict | ||
◉ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 cf73917d conflict | ||
│ my description | ||
◉ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 6fbba7bc | ||
│ my description | ||
|
@@ -44,11 +44,11 @@ fn test_obslog_with_or_without_diff() { | |
insta::assert_snapshot!(stdout, @r###" | ||
@ [1m[38;5;13mr[38;5;8mlvkpnrz[39m [38;5;[email protected][39m [38;5;14m2001-02-03 08:05:10[39m [38;5;12m6[38;5;8m6b42ad3[39m[0m | ||
│ [1mmy description[0m | ||
◉ [1m[39mr[0m[38;5;8mlvkpnrz[39m hidden [38;5;[email protected][39m [38;5;6m2001-02-03 08:05:09[39m [1m[38;5;4meb[0m[38;5;8mc23d4b[39m [38;5;1mconflict[39m | ||
◉ [1m[39mr[0m[38;5;8mlvkpnrz[39m hidden [38;5;[email protected][39m [38;5;6m2001-02-03 08:05:09[39m [1m[38;5;4mc[0m[38;5;8mf73917d[39m [38;5;1mconflict[39m | ||
│ my description | ||
◉ [1m[39mr[0m[38;5;8mlvkpnrz[39m hidden [38;5;[email protected][39m [38;5;6m2001-02-03 08:05:09[39m [1m[38;5;4m6f[0m[38;5;8mbba7bc[39m | ||
│ my description | ||
◉ [1m[39mr[0m[38;5;8mlvkpnrz[39m hidden [38;5;[email protected][39m [38;5;6m2001-02-03 08:05:08[39m [1m[38;5;4mea[0m[38;5;8mc0d0da[39m | ||
◉ [1m[39mr[0m[38;5;8mlvkpnrz[39m hidden [38;5;[email protected][39m [38;5;6m2001-02-03 08:05:08[39m [1m[38;5;4me[0m[38;5;8mac0d0da[39m | ||
[38;5;2m(empty)[39m my description | ||
"###); | ||
|
||
|
@@ -66,7 +66,7 @@ fn test_obslog_with_or_without_diff() { | |
│ 5 : foo | ||
│ 6 : bar | ||
│ 7 : >>>>>>> | ||
◉ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 ebc23d4b conflict | ||
◉ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 cf73917d conflict | ||
│ my description | ||
◉ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 6fbba7bc | ||
│ my description | ||
|
@@ -84,7 +84,7 @@ fn test_obslog_with_or_without_diff() { | |
insta::assert_snapshot!(stdout, @r###" | ||
@ rlvkpnrz [email protected] 2001-02-03 08:05:10 66b42ad3 | ||
│ my description | ||
◉ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 ebc23d4b conflict | ||
◉ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 cf73917d conflict | ||
│ my description | ||
"###); | ||
|
||
|
@@ -93,7 +93,7 @@ fn test_obslog_with_or_without_diff() { | |
insta::assert_snapshot!(stdout, @r###" | ||
rlvkpnrz [email protected] 2001-02-03 08:05:10 66b42ad3 | ||
my description | ||
rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 ebc23d4b conflict | ||
rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 cf73917d conflict | ||
my description | ||
rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 6fbba7bc | ||
my description | ||
|
@@ -119,7 +119,7 @@ fn test_obslog_with_or_without_diff() { | |
-bar | ||
->>>>>>> | ||
+resolved | ||
rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 ebc23d4b conflict | ||
rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 cf73917d conflict | ||
my description | ||
rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 6fbba7bc | ||
my description | ||
|
@@ -162,7 +162,7 @@ fn test_obslog_with_custom_symbols() { | |
insta::assert_snapshot!(stdout, @r###" | ||
$ rlvkpnrz [email protected] 2001-02-03 08:05:10 66b42ad3 | ||
│ my description | ||
┝ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 ebc23d4b conflict | ||
┝ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 cf73917d conflict | ||
│ my description | ||
┝ rlvkpnrz hidden [email protected] 2001-02-03 08:05:09 6fbba7bc | ||
│ my description | ||
|
Oops, something went wrong.