2021-10-22 20:56:30 +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 in the octocat/Hello-World repo.
|
|
|
|
We have an empty working copy on top of master:"
|
2021-10-22 20:56:30 +00:00
|
|
|
run_command "jj status"
|
2021-10-28 03:38:56 +00:00
|
|
|
run_command "jj log"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Now make some changes in the working copy:"
|
2021-10-22 20:56:30 +00:00
|
|
|
run_command "echo \"Goodbye World!\" > README"
|
|
|
|
run_command "echo stuff > new-file"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Our working copy's commit ID changed
|
|
|
|
because we made changes:"
|
2021-10-22 20:56:30 +00:00
|
|
|
run_command "jj status"
|
2021-10-28 03:38:56 +00:00
|
|
|
run_command "jj log"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Add a branch so we can easily refer to this
|
|
|
|
commit:"
|
2022-06-09 20:58:34 +00:00
|
|
|
run_command "jj branch create goodbye"
|
2021-10-28 03:38:56 +00:00
|
|
|
run_command "jj log"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Start working on a new change off of master:"
|
2021-10-22 20:56:30 +00:00
|
|
|
run_command "jj co master"
|
2021-10-28 03:38:56 +00:00
|
|
|
run_command "jj log"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Note that the working copy is now clean; the
|
|
|
|
\"goodbye\" change stayed in its own commit:"
|
2021-10-22 20:56:30 +00:00
|
|
|
run_command "jj status"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Modify a file in this new change:"
|
2021-10-22 20:56:30 +00:00
|
|
|
run_command "echo \"Hello everyone!\" > README"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "The working copy is not special; we can, for
|
|
|
|
example, set the description of any commit.
|
|
|
|
First, set it on the working copy:"
|
2021-10-22 20:56:30 +00:00
|
|
|
run_command "jj describe -m everyone"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Now set it on the change we worked on before:"
|
2021-10-22 20:56:30 +00:00
|
|
|
run_command "jj describe goodbye -m goodbye"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "Inspect the result:"
|
2021-10-22 20:56:30 +00:00
|
|
|
run_command "jj log"
|
2023-02-09 00:26:55 +00:00
|
|
|
|
|
|
|
blank
|