Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
demos: rearrange and reword portions of demos
Browse files Browse the repository at this point in the history
This is mainly to account for the fact that most commands now report
more information about the state of the repo.
ilyagr committed Sep 10, 2023
1 parent 644fb32 commit 6bc96ce
Showing 4 changed files with 20 additions and 23 deletions.
1 change: 1 addition & 0 deletions demos/demo_git_compat.sh
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ run_command "cd Hello-World"

comment "Inspect it:"
run_command "jj log -r 'all()'"
blank
run_command "jj diff -r b1"

comment "The repo is backed by the actual Git repo:"
10 changes: 4 additions & 6 deletions demos/demo_juggle_conflicts.sh
Original file line number Diff line number Diff line change
@@ -26,13 +26,11 @@ comment "Let's reorder the second and third commits:"
run_command "jj rebase -s third -d first"
run_command "jj rebase -s second -d third"
run_command "jj log"
comment "The commit labeled \"third\" has a conflict,
as expected. What's more interesting is
that the top commit has no conflict! That's
because it has the changes from all three
commits applied to it."
comment "The commit labeled \"third\" has a conflict, as expected. What's more
interesting is that the top commit has no conflict! That's because it
has the changes from all three commits applied to it.
comment "Let's verify that by looking at its contents:"
Let's verify that by looking at its contents:"
run_command "jj co second"
run_command "cat file"

15 changes: 7 additions & 8 deletions demos/demo_resolve_conflicts.sh
Original file line number Diff line number Diff line change
@@ -16,21 +16,20 @@ run_command "jj describe -m \"README: say which world\""
run_command "echo \"Hello Earth!\" > README"
run_command "jj diff"

comment "We're going to rebase it onto commit b1.
comment "We're going to rebase it onto commit b1b.
That commit looks like this:"
run_command "jj diff -r b1"
run_command "jj diff -r b1b"

comment "Now rebase:"
run_command "jj rebase -d b1"
run_command "jj rebase -d b1b"

comment "Huh, that seemed to succeed. Let's take a
look at the repo:"
comment "That seemed to succeed but we are also told there is now a conflict.
Let's take a look at the repo:"
run_command "jj log -r 'all()'"
run_command "jj status"

comment "As you can see, the rebased commit has a
conflict. The file in the working copy looks
like this:"
comment "Indeed, the rebased commit has a conflict. The conflicted file
in the working copy looks like this:"
run_command "cat README"

comment "Now we will resolve the conflict:"
17 changes: 8 additions & 9 deletions demos/demo_working_copy.sh
Original file line number Diff line number Diff line change
@@ -8,17 +8,16 @@ cd Hello-World

comment "We are in the octocat/Hello-World repo.
We have an empty working copy on top of master:"
run_command "jj status"
run_command "jj log"
run_command "jj status"

comment "Now make some changes in the working copy:"
run_command "echo \"Goodbye World!\" > README"
run_command "echo stuff > new-file"

comment "Our working copy's commit ID changed
because we made changes:"
comment "Because of these changes, our working copy is no longer marked as \"empty\".
Also, its commit ID (starting with a blue character) changed:"
run_command "jj status"
run_command "jj log"

comment "Add a branch so we can easily refer to this
commit:"
@@ -27,10 +26,12 @@ run_command "jj log"

comment "Start working on a new change off of master:"
run_command "jj co master"
run_command "jj log"

comment "Note that the working copy is now clean; the
comment "Note that we were told the working copy is now empty (AKA clean). The
\"goodbye\" change stayed in its own commit:"

run_command "jj log"
comment "Let's do a sanity check: 'jj status' should tell us that
the working copy is clean."
run_command "jj status"

comment "Modify a file in this new change:"
@@ -46,5 +47,3 @@ run_command "jj describe goodbye -m goodbye"

comment "Inspect the result:"
run_command "jj log"

blank

0 comments on commit 6bc96ce

Please sign in to comment.