1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
|
// Copyright 2023 The Jujutsu Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::common::TestEnvironment;
#[test]
fn test_rewrite_immutable_generic() {
let test_env = TestEnvironment::default();
test_env.run_jj_in(".", ["git", "init", "repo"]).success();
let work_dir = test_env.work_dir("repo");
work_dir.write_file("file", "a");
work_dir.run_jj(["describe", "-m=a"]).success();
work_dir.run_jj(["new", "-m=b"]).success();
work_dir.write_file("file", "b");
work_dir
.run_jj(["bookmark", "create", "-r@", "main"])
.success();
work_dir.run_jj(["new", "main-", "-m=c"]).success();
work_dir.write_file("file", "c");
let output = work_dir.run_jj(["log"]);
insta::assert_snapshot!(output, @r"
@ mzvwutvl test.user@example.com 2001-02-03 08:05:12 a6923629
│ c
│ ○ kkmpptxz test.user@example.com 2001-02-03 08:05:10 main 9d190342
├─╯ b
○ qpvuntsm test.user@example.com 2001-02-03 08:05:08 c8c8515a
│ a
◆ zzzzzzzz root() 00000000
[EOF]
");
// Cannot rewrite a commit in the configured set
test_env.add_config(r#"revset-aliases."immutable_heads()" = "main""#);
let output = work_dir.run_jj(["edit", "main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 9d190342454d is immutable
Hint: Could not modify commit: kkmpptxz 9d190342 main | b
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// Cannot rewrite an ancestor of the configured set
let output = work_dir.run_jj(["edit", "main-"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit c8c8515af455 is immutable
Hint: Could not modify commit: qpvuntsm c8c8515a a
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 2 immutable commits.
[EOF]
[exit status: 1]
"#);
// Cannot rewrite the root commit even with an empty set of immutable commits
test_env.add_config(r#"revset-aliases."immutable_heads()" = "none()""#);
let output = work_dir.run_jj(["edit", "root()"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Error: The root commit 000000000000 is immutable
[EOF]
[exit status: 1]
");
// Error mutating the repo if immutable_heads() uses a ref that can't be
// resolved
test_env.add_config(r#"revset-aliases."immutable_heads()" = "bookmark_that_does_not_exist""#);
// Suppress warning in the commit summary template
test_env.add_config("template-aliases.'format_short_id(id)' = 'id.short(8)'");
let output = work_dir.run_jj(["new", "main"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Config error: Invalid `revset-aliases.immutable_heads()`
Caused by: Revision `bookmark_that_does_not_exist` doesn't exist
For help, see https://jj-vcs.github.io/jj/latest/config/ or use `jj help -k config`.
[EOF]
[exit status: 1]
");
// Can use --ignore-immutable to override
test_env.add_config(r#"revset-aliases."immutable_heads()" = "main""#);
let output = work_dir.run_jj(["--ignore-immutable", "edit", "main"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Working copy (@) now at: kkmpptxz 9d190342 main | b
Parent commit (@-) : qpvuntsm c8c8515a a
Added 0 files, modified 1 files, removed 0 files
[EOF]
");
// ... but not the root commit
let output = work_dir.run_jj(["--ignore-immutable", "edit", "root()"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Error: The root commit 000000000000 is immutable
[EOF]
[exit status: 1]
");
// Mutating the repo works if ref is wrapped in present()
test_env.add_config(
r#"revset-aliases."immutable_heads()" = "present(bookmark_that_does_not_exist)""#,
);
let output = work_dir.run_jj(["new", "main"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Working copy (@) now at: wqnwkozp 8fc35e6e (empty) (no description set)
Parent commit (@-) : kkmpptxz 9d190342 main | b
[EOF]
");
// immutable_heads() of different arity doesn't shadow the 0-ary one
test_env.add_config(r#"revset-aliases."immutable_heads(foo)" = "none()""#);
let output = work_dir.run_jj(["edit", "root()"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Error: The root commit 000000000000 is immutable
[EOF]
[exit status: 1]
");
}
#[test]
fn test_new_wc_commit_when_wc_immutable() {
let test_env = TestEnvironment::default();
test_env.run_jj_in(".", ["git", "init"]).success();
let work_dir = test_env.work_dir("");
work_dir
.run_jj(["bookmark", "create", "-r@", "main"])
.success();
test_env.add_config(r#"revset-aliases."immutable_heads()" = "main""#);
work_dir.run_jj(["new", "-m=a"]).success();
let output = work_dir.run_jj(["bookmark", "set", "main", "-r@"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Moved 1 bookmarks to kkmpptxz 28e8c405 main | (empty) a
Warning: The working-copy commit in workspace 'default' became immutable, so a new commit has been created on top of it.
Working copy (@) now at: zsuskuln e9901f56 (empty) (no description set)
Parent commit (@-) : kkmpptxz 28e8c405 main | (empty) a
[EOF]
");
}
#[test]
fn test_immutable_heads_set_to_working_copy() {
let test_env = TestEnvironment::default();
test_env.run_jj_in(".", ["git", "init"]).success();
let work_dir = test_env.work_dir("");
work_dir
.run_jj(["bookmark", "create", "-r@", "main"])
.success();
test_env.add_config(r#"revset-aliases."immutable_heads()" = "@""#);
let output = work_dir.run_jj(["new", "-m=a"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Warning: The working-copy commit in workspace 'default' became immutable, so a new commit has been created on top of it.
Working copy (@) now at: pmmvwywv ca5945b4 (empty) (no description set)
Parent commit (@-) : kkmpptxz b693e0ee (empty) a
[EOF]
");
}
#[test]
fn test_new_wc_commit_when_wc_immutable_multi_workspace() {
let test_env = TestEnvironment::default();
test_env.run_jj_in(".", ["git", "init", "repo"]).success();
let work_dir = test_env.work_dir("repo");
work_dir
.run_jj(["bookmark", "create", "-r@", "main"])
.success();
test_env.add_config(r#"revset-aliases."immutable_heads()" = "main""#);
work_dir.run_jj(["new", "-m=a"]).success();
work_dir
.run_jj(["workspace", "add", "../workspace1"])
.success();
let workspace1_dir = test_env.work_dir("workspace1");
workspace1_dir.run_jj(["edit", "default@"]).success();
let output = work_dir.run_jj(["bookmark", "set", "main", "-r@"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Moved 1 bookmarks to kkmpptxz e1cb4cf3 main | (empty) a
Warning: The working-copy commit in workspace 'default' became immutable, so a new commit has been created on top of it.
Warning: The working-copy commit in workspace 'workspace1' became immutable, so a new commit has been created on top of it.
Working copy (@) now at: royxmykx cec19492 (empty) (no description set)
Parent commit (@-) : kkmpptxz e1cb4cf3 main | (empty) a
[EOF]
");
workspace1_dir
.run_jj(["workspace", "update-stale"])
.success();
let output = workspace1_dir.run_jj(["log", "--no-graph"]);
insta::assert_snapshot!(output, @r"
nppvrztz test.user@example.com 2001-02-03 08:05:12 workspace1@ e89ed162
(empty) (no description set)
royxmykx test.user@example.com 2001-02-03 08:05:12 default@ cec19492
(empty) (no description set)
kkmpptxz test.user@example.com 2001-02-03 08:05:09 main e1cb4cf3
(empty) a
zzzzzzzz root() 00000000
[EOF]
");
}
#[test]
fn test_rewrite_immutable_commands() {
let test_env = TestEnvironment::default();
test_env.run_jj_in(".", ["git", "init", "repo"]).success();
let work_dir = test_env.work_dir("repo");
work_dir.write_file("file", "a");
work_dir.run_jj(["describe", "-m=a"]).success();
work_dir.run_jj(["new", "-m=b"]).success();
work_dir.write_file("file", "b");
work_dir.run_jj(["new", "@-", "-m=c"]).success();
work_dir.write_file("file", "c");
work_dir
.run_jj(["new", "all:visible_heads()", "-m=merge"])
.success();
// Create another file to make sure the merge commit isn't empty (to satisfy `jj
// split`) and still has a conflict (to satisfy `jj resolve`).
work_dir.write_file("file2", "merged");
work_dir
.run_jj(["bookmark", "create", "-r@", "main"])
.success();
work_dir.run_jj(["new", "description(b)"]).success();
work_dir.write_file("file", "w");
test_env.add_config(r#"revset-aliases."immutable_heads()" = "main""#);
test_env.add_config(r#"revset-aliases."trunk()" = "main""#);
// Log shows mutable commits, their parents, and trunk() by default
let output = work_dir.run_jj(["log"]);
insta::assert_snapshot!(output, @r"
@ yqosqzyt test.user@example.com 2001-02-03 08:05:14 55c97dc7
│ (no description set)
│ ◆ mzvwutvl test.user@example.com 2001-02-03 08:05:12 main 4397373a conflict
╭─┤ merge
│ │
│ ~
│
◆ kkmpptxz test.user@example.com 2001-02-03 08:05:10 9d190342
│ b
~
[EOF]
");
// abandon
let output = work_dir.run_jj(["abandon", "main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// absorb
let output = work_dir.run_jj(["absorb", "--into=::@-"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 9d190342454d is immutable
Hint: Could not modify commit: kkmpptxz 9d190342 b
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 2 immutable commits.
[EOF]
[exit status: 1]
"#);
// chmod
let output = work_dir.run_jj(["file", "chmod", "-r=main", "x", "file"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// describe
let output = work_dir.run_jj(["describe", "main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// diffedit
let output = work_dir.run_jj(["diffedit", "-r=main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// edit
let output = work_dir.run_jj(["edit", "main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// new --insert-before
let output = work_dir.run_jj(["new", "--insert-before", "main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// new --insert-after parent_of_main
let output = work_dir.run_jj(["new", "--insert-after", "description(b)"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// parallelize
let output = work_dir.run_jj(["parallelize", "description(b)", "main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// rebase -s
let output = work_dir.run_jj(["rebase", "-s=main", "-d=@"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// rebase -b
let output = work_dir.run_jj(["rebase", "-b=main", "-d=@"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit dfa21421ac56 is immutable
Hint: Could not modify commit: zsuskuln dfa21421 c
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 2 immutable commits.
[EOF]
[exit status: 1]
"#);
// rebase -r
let output = work_dir.run_jj(["rebase", "-r=main", "-d=@"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// resolve
let output = work_dir.run_jj(["resolve", "-r=description(merge)", "file"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// restore -c
let output = work_dir.run_jj(["restore", "-c=main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// restore --into
let output = work_dir.run_jj(["restore", "--into=main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// split
let output = work_dir.run_jj(["split", "-r=main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// split -B
let output = work_dir.run_jj(["split", "-B=main", "-m", "will fail", "file"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// squash -r
let output = work_dir.run_jj(["squash", "-r=description(b)"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 9d190342454d is immutable
Hint: Could not modify commit: kkmpptxz 9d190342 b
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 4 immutable commits.
[EOF]
[exit status: 1]
"#);
// squash --from
let output = work_dir.run_jj(["squash", "--from=main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// squash --into
let output = work_dir.run_jj(["squash", "--into=main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// sign
let output = work_dir.run_jj(["sign", "-r=main", "--config=signing.backend=test"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
// unsign
let output = work_dir.run_jj(["unsign", "-r=main"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Error: Commit 4397373a0991 is immutable
Hint: Could not modify commit: mzvwutvl 4397373a main | (conflict) merge
Hint: Immutable commits are used to protect shared history.
Hint: For more information, see:
- https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits
- `jj help -k config`, "Set of immutable commits"
Hint: This operation would rewrite 1 immutable commits.
[EOF]
[exit status: 1]
"#);
}
|