2021-10-23 16:06:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
. "$(dirname "$0")"/demo_helpers.sh
|
|
|
|
parse_args "$@"
|
|
|
|
|
|
|
|
new_tmp_dir
|
|
|
|
jj git clone https://github.com/octocat/Hello-World
|
|
|
|
cd Hello-World
|
|
|
|
|
|
|
|
run_demo 'Basic conflict resolution flow' '
|
2021-10-27 22:07:46 +00:00
|
|
|
run_command "# We are on the master branch of the"
|
|
|
|
run_command "# octocat/Hello-World repo:"
|
2022-05-14 15:55:46 +00:00
|
|
|
run_command "jj log -r '\''all()'\''"
|
2021-10-23 16:06:40 +00:00
|
|
|
pause 7
|
2021-10-27 22:07:46 +00:00
|
|
|
run_command "# Let'\''s make an edit that will conflict"
|
|
|
|
run_command "# when we rebase it:"
|
|
|
|
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"
|
|
|
|
pause 2
|
2021-10-27 23:35:48 +00:00
|
|
|
run_command ""
|
2021-10-27 22:07:46 +00:00
|
|
|
run_command "# We'\''re going to rebase it onto commit b1."
|
|
|
|
run_command "# That commit looks like this:"
|
2021-10-23 16:06:40 +00:00
|
|
|
run_command "jj diff -r b1"
|
|
|
|
pause 2
|
2021-10-27 23:35:48 +00:00
|
|
|
run_command ""
|
2021-10-23 16:06:40 +00:00
|
|
|
run_command "# Now rebase:"
|
|
|
|
run_command "jj rebase -d b1"
|
2021-10-27 23:35:48 +00:00
|
|
|
run_command ""
|
2021-10-27 22:07:46 +00:00
|
|
|
run_command "# Huh, that seemed to succeed. Let'\''s take a"
|
|
|
|
run_command "# look at the repo:"
|
2021-11-06 23:08:00 +00:00
|
|
|
pause 2
|
2022-05-14 15:55:46 +00:00
|
|
|
run_command "jj log -r '\''all()'\''"
|
2021-11-06 23:08:00 +00:00
|
|
|
pause 4
|
|
|
|
run_command "jj status"
|
|
|
|
pause 3
|
2021-10-27 22:07:46 +00:00
|
|
|
run_command "# As you can see, the rebased commit has a"
|
|
|
|
run_command "# conflict. The file in the working copy looks"
|
|
|
|
run_command "# like this:"
|
2021-10-23 16:06:40 +00:00
|
|
|
run_command "cat README"
|
|
|
|
pause 5
|
2021-10-27 23:35:48 +00:00
|
|
|
run_command ""
|
2021-10-23 16:06:40 +00:00
|
|
|
run_command "# Now we will resolve the conflict:"
|
|
|
|
run_command "echo \"Hello earth!\" > README"
|
|
|
|
pause 2
|
2021-10-27 23:35:48 +00:00
|
|
|
run_command ""
|
2021-11-06 23:08:00 +00:00
|
|
|
run_command "# The status command no longer reports it:"
|
|
|
|
run_command "jj status"
|
2021-10-23 16:06:40 +00:00
|
|
|
pause 2
|
|
|
|
'
|