2021-10-22 16:24:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
2023-08-28 22:42:44 +00:00
|
|
|
. "$(dirname "$0")"/helpers.sh
|
2021-10-22 16:24:02 +00:00
|
|
|
|
|
|
|
new_tmp_dir
|
|
|
|
|
2022-10-21 05:13:09 +00:00
|
|
|
comment "Clone a Git repo:"
|
2021-10-22 16:24:02 +00:00
|
|
|
run_command "jj git clone https://github.com/octocat/Hello-World"
|
|
|
|
run_command "cd Hello-World"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
2023-09-10 04:17:47 +00:00
|
|
|
blank
|
2024-08-08 05:36:01 +00:00
|
|
|
|
|
|
|
comment "By default, \"jj\" creates a local master branch tracking the remote master
|
|
|
|
branch. The other branches are only available as remote-tracking branches."
|
|
|
|
run_command "jj branch list --all"
|
|
|
|
comment "We can create a local branch tracking one of the remote branches we just
|
|
|
|
fetched."
|
|
|
|
run_command "jj branch track octocat-patch-1@origin"
|
|
|
|
|
|
|
|
comment "By default, \"jj log\" excludes untracked remote branches to focus on
|
|
|
|
\"our\" commits."
|
|
|
|
run_command "jj log"
|
|
|
|
|
|
|
|
comment "We can also ask \"jj\" to show all the commits."
|
|
|
|
run_command "jj log -r 'all()'"
|
|
|
|
|
|
|
|
comment "We can look at the diffs of commits in the repo"
|
2021-10-22 16:24:02 +00:00
|
|
|
run_command "jj diff -r b1"
|
2024-08-08 05:36:01 +00:00
|
|
|
blank
|
|
|
|
run_command "jj diff -r b3"
|
2022-10-21 05:13:09 +00:00
|
|
|
|
|
|
|
comment "The repo is backed by the actual Git repo:"
|
2022-02-18 06:20:14 +00:00
|
|
|
run_command "git --git-dir=.jj/repo/store/git log --graph --all --decorate --oneline"
|
2023-02-09 00:26:55 +00:00
|
|
|
|
|
|
|
blank
|