| 1 |
#!/bin/bash |
| 2 |
set -euo pipefail |
| 3 |
. "$(dirname "$0")"/helpers.sh |
| 4 |
|
| 5 |
new_tmp_dir |
| 6 |
|
| 7 |
comment "Clone a Git repo:" |
| 8 |
run_command "jj git clone https://github.com/octocat/Hello-World" |
| 9 |
run_command "cd Hello-World" |
| 10 |
|
| 11 |
blank |
| 12 |
|
| 13 |
comment "By default, \"jj\" creates a local bookmark \"master\" tracking the remote master |
| 14 |
branch. Other remote branches are only available as remote-tracking bookmarks." |
| 15 |
run_command "jj bookmark list --all" |
| 16 |
comment "We can create a local bookmark tracking one of the remote branches we just |
| 17 |
fetched." |
| 18 |
run_command "jj bookmark track octocat-patch-1 --remote=origin" |
| 19 |
|
| 20 |
comment "By default, \"jj log\" excludes untracked remote branches to focus on |
| 21 |
\"our\" commits." |
| 22 |
run_command "jj log" |
| 23 |
|
| 24 |
comment "We can also ask \"jj\" to show all the commits." |
| 25 |
run_command "jj log -r 'all()'" |
| 26 |
|
| 27 |
comment "We can look at the diffs of commits in the repo" |
| 28 |
run_command "jj diff -r b1" |
| 29 |
blank |
| 30 |
run_command "jj diff -r b3" |
| 31 |
|
| 32 |
comment "We can generate a 'git format-patch' compatible diff" |
| 33 |
run_command "jj show --git --template git_format_patch_email_headers" |
| 34 |
|
| 35 |
comment "The repo is backed by the actual Git repo:" |
| 36 |
run_command "git log --graph --all --decorate --oneline" |
| 37 |
|
| 38 |
blank |