2021-10-23 16:06:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
. "$(dirname "$0")"/demo_helpers.sh
|
|
|
|
|
|
|
|
new_tmp_dir
|
|
|
|
jj git clone https://github.com/octocat/Hello-World
|
|
|
|
cd Hello-World
|
|
|
|
|
2022-10-21 05:13:09 +00:00
|
|
|
comment "We are on the master branch of the
|
|
|
|
octocat/Hello-World repo:"
|
|
|
|
run_command "jj log -r 'all()'"
|
|
|
|
|
|
|
|
comment "Let's make an edit that will conflict
|
|
|
|
when we rebase it:"
|
2021-10-27 22:07:46 +00:00
|
|
|
run_command "jj describe -m \"README: say which world\""
|
2021-10-23 16:06:40 +00:00
|
|
|
run_command "echo \"Hello Earth!\" > README"
|
|
|
|
run_command "jj diff"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "We're going to rebase it onto commit b1.
|
|
|
|
That commit looks like this:"
|
2021-10-23 16:06:40 +00:00
|
|
|
run_command "jj diff -r b1"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Now rebase:"
|
2021-10-23 16:06:40 +00:00
|
|
|
run_command "jj rebase -d b1"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Huh, that seemed to succeed. Let's take a
|
|
|
|
look at the repo:"
|
|
|
|
run_command "jj log -r 'all()'"
|
2021-11-06 23:08:00 +00:00
|
|
|
run_command "jj status"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "As you can see, the rebased commit has a
|
|
|
|
conflict. The file in the working copy looks
|
|
|
|
like this:"
|
2021-10-23 16:06:40 +00:00
|
|
|
run_command "cat README"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Now we will resolve the conflict:"
|
2021-10-23 16:06:40 +00:00
|
|
|
run_command "echo \"Hello earth!\" > README"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "The status command no longer reports it:"
|
2021-11-06 23:08:00 +00:00
|
|
|
run_command "jj status"
|
2023-02-09 00:26:55 +00:00
|
|
|
|
|
|
|
blank
|