diff --git a/demos/demo_git_compat.sh b/demos/demo_git_compat.sh index 6b841c88b..b45e37578 100755 --- a/demos/demo_git_compat.sh +++ b/demos/demo_git_compat.sh @@ -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:" diff --git a/demos/demo_juggle_conflicts.sh b/demos/demo_juggle_conflicts.sh index 9ce0179b7..301672663 100755 --- a/demos/demo_juggle_conflicts.sh +++ b/demos/demo_juggle_conflicts.sh @@ -28,13 +28,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" diff --git a/demos/demo_operation_log.sh b/demos/demo_operation_log.sh index 6eb04388a..55bba4a12 100755 --- a/demos/demo_operation_log.sh +++ b/demos/demo_operation_log.sh @@ -27,7 +27,7 @@ comment "The repo now looks like this:" run_command "jj log" comment "The most recent portion of the operation log is:" -run_command_allow_broken_pipe "jj op log | head" +run_command_allow_broken_pipe "jj op log --limit 4" comment "Let's undo that rebase operation:" rebase_op=$(jj --color=never op log --no-graph -T 'id.short(5)' --limit 1 --at-op @--) diff --git a/demos/demo_resolve_conflicts.sh b/demos/demo_resolve_conflicts.sh index a83dc646e..76411eb33 100755 --- a/demos/demo_resolve_conflicts.sh +++ b/demos/demo_resolve_conflicts.sh @@ -16,6 +16,10 @@ run_command "jj describe -m \"README: say which world\"" run_command "echo \"Hello Earth!\" > README" run_command "jj diff" +# TODO(ilyagr): Get the real shortest prefix of the b1b commit using `jj log +# --no-graph` and the `.shortest()` template function. +# +# This could also be done in demo_git_compat.sh, but that might not be worth it. comment "We're going to rebase it onto commit b1. That commit looks like this:" run_command "jj diff -r b1" @@ -23,14 +27,13 @@ run_command "jj diff -r b1" comment "Now rebase:" run_command "jj rebase -d b1" -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:" diff --git a/demos/demo_working_copy.sh b/demos/demo_working_copy.sh index e8085c6c7..7e36197c6 100755 --- a/demos/demo_working_copy.sh +++ b/demos/demo_working_copy.sh @@ -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,24 +26,27 @@ 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:" run_command "echo \"Hello everyone!\" > README" +run_command "jj status" comment "The working copy is not special; we can, for example, set the description of any commit. First, set it on the working copy:" -run_command "jj describe -m everyone" +# The output with the description of the working copy slightly messes up the +# parallel between the working copy and another commit, so we redact it. +run_command_output_redacted "jj describe -m everyone" comment "Now set it on the change we worked on before:" run_command "jj describe goodbye -m goodbye" comment "Inspect the result:" run_command "jj log" - -blank diff --git a/demos/git_compat.svg b/demos/git_compat.svg index eced37bf1..7e6184de5 100644 --- a/demos/git_compat.svg +++ b/demos/git_compat.svg @@ -1,5 +1,5 @@ - + - + # Clone a Git repo: $ jj git clone https://github.com/octocat/Hello-World -Fetching into new repo in "/tmp/tmp.PUd3syX7da/Hello-World" -Working copy now at: pxlotqpw e905ce63 (empty) (no description set) -Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr +Fetching into new repo in "/tmp/tmp.8MxGFBZpqj/Hello-World" +Working copy now at: oplronuy 0af35f48 (empty) (no description set) +Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr om Spaceghost/patch-1 Added 1 files, modified 0 files, removed 0 files $ cd Hello-World @@ -49,39 +49,40 @@ # Inspect it: $ jj log -r 'all()' -@  pxlotqpw jjfan@example.com 2023-10-01 22:29:21.000 -07:00 e905ce63 +@  oplronuy jjfan@example.com 2023-10-03 17:52:06.000 -07:00 0af35f48 │  (empty) (no description set) │ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 ├─╯  octocat-patch-1 b1b3f972 │    sentence case │ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb ├─╯  Create CONTRIBUTING.md -◉    orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b +◉    orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b ├─╮  (empty) Merge pull request #6 from Spaceghost/patch-1 │ ◉  nznozkvv Johnneylee.rollins@gmail.com 2011-09-13 21:42:41.000 -07:00 ├─╯  76294131 │    New line at end of file. --Signed off by Spaceghost ◉  syktoqts cameron@github.com 2011-01-26 11:06:08.000 -08:00 553c2077 │  first commit -◉  zzzzzzzz root() 00000000 -$ jj diff -r b1 -Modified regular file README: -   1    1: Hello Worldworld! - -# The repo is backed by the actual Git repo: - -$ git --git-dir=.jj/repo/store/git log --graph --all --decorate --oneline -e905ce6  -| * d7ab898  -| * b1b3f97 (origin/octocat-patch-1) sentence case -|/   -| * b3cbd5b (origin/test) Create CONTRIBUTING.md -|/   -*   7fd1a60 (origin/master) Merge pull request #6 from Spaceghost/patch-1 -|\   -| * 7629413 New line at end of file. --Signed off by Spaceghost -|/   -553c207 first commit +◉  zzzzzzzz root() 00000000 + +$ jj diff -r b1 +Modified regular file README: +   1    1: Hello Worldworld! + +# The repo is backed by the actual Git repo: + +$ git --git-dir=.jj/repo/store/git log --graph --all --decorate --oneline +b79d37f  +0af35f4  +| * b1b3f97 (origin/octocat-patch-1) sentence case +|/   +| * b3cbd5b (origin/test) Create CONTRIBUTING.md +|/   +*   7fd1a60 (origin/master) Merge pull request #6 from Spaceghost/patch-1 +|\   +| * 7629413 New line at end of file. --Signed off by Spaceghost +|/   +553c207 first commit diff --git a/demos/helpers.sh b/demos/helpers.sh index a6d9870e5..c3dcf2409 100644 --- a/demos/helpers.sh +++ b/demos/helpers.sh @@ -16,6 +16,14 @@ run_command() { COLUMNS=${RUN_COMMAND_COLUMNS-${COLUMNS-80}} eval "$@" } +run_command_output_redacted() { + echo "\$ $@" + # `bash` often resets $COLUMNS, so we also + # allow $RUN_COMMAND_COLUMNS + eval "$@" > /dev/null + echo -e "\033[0;90m... (output redacted) ...\033[0m" +} + run_command_allow_broken_pipe() { run_command "$@" || { EXITCODE="$?" diff --git a/demos/juggle_conflicts.svg b/demos/juggle_conflicts.svg index 1ea98f849..dfa494495 100644 --- a/demos/juggle_conflicts.svg +++ b/demos/juggle_conflicts.svg @@ -1,5 +1,5 @@ - + - + # We are in a repo with three commits, all # editing the same line: $ jj log -@  upqsurwq jjfan@example.com 2023-10-01 22:29:22.258 -07:00 5d13bfb2 +@  rtrqxtor jjfan@example.com 2023-10-03 17:52:07.433 -07:00 d728789b │  (empty) (no description set) -◉  ltqxzzvn jjfan@example.com 2023-10-01 22:29:22.258 -07:00 third d7689062 +◉  qsyokrkk jjfan@example.com 2023-10-03 17:52:07.433 -07:00 third 85066d2a │  third -◉  nrlsumvr jjfan@example.com 2023-10-01 22:29:22.202 -07:00 second 483c2b23 +◉  pmlzoorv jjfan@example.com 2023-10-03 17:52:07.372 -07:00 second 6a11efb9 │  second -◉  pumwmyut jjfan@example.com 2023-10-01 22:29:22.147 -07:00 first eb0ec5cc +◉  mzssttms jjfan@example.com 2023-10-03 17:52:07.312 -07:00 first c2cb2cfa │  first ◉  zzzzzzzz root() 00000000 $ jj diff -r first @@ -63,68 +63,65 @@ $ jj rebase -s third -d first Rebased 2 commits -Working copy now at: upqsurwq 4d810169 (conflict) (empty) (no description set) -Parent commit      : ltqxzzvn 0aa4eff7 third | (conflict) third +Working copy now at: rtrqxtor b88d4fbd (conflict) (empty) (no description set) +Parent commit      : qsyokrkk ab068262 third | (conflict) third Added 0 files, modified 1 files, removed 0 files $ jj rebase -s second -d third Rebased 1 commits $ jj log -◉  nrlsumvr jjfan@example.com 2023-10-01 22:29:22.435 -07:00 second a8e2d400 +◉  pmlzoorv jjfan@example.com 2023-10-03 17:52:07.615 -07:00 second 60ef6ed1 │  second -│ @  upqsurwq jjfan@example.com 2023-10-01 22:29:22.406 -07:00 4d810169 conflict +│ @  rtrqxtor jjfan@example.com 2023-10-03 17:52:07.583 -07:00 b88d4fbd conflict ├─╯  (empty) (no description set) -◉  ltqxzzvn jjfan@example.com 2023-10-01 22:29:22.406 -07:00 third 0aa4eff7 +◉  qsyokrkk jjfan@example.com 2023-10-03 17:52:07.583 -07:00 third ab068262 │  conflict │  third -◉  pumwmyut jjfan@example.com 2023-10-01 22:29:22.147 -07:00 first eb0ec5cc +◉  mzssttms jjfan@example.com 2023-10-03 17:52:07.312 -07:00 first c2cb2cfa │  first -◉  zzzzzzzz root() 00000000 +◉  zzzzzzzz root() 00000000 -# 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. +# 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. + +# Let's verify that by looking at its contents: - -# Let's verify that by looking at its contents: - -$ jj co second -Working copy now at: mqslnlrv e1967a3c (empty) (no description set) -Parent commit      : nrlsumvr a8e2d400 second | second -Added 0 files, modified 1 files, removed 0 files -$ cat file -third +$ jj co second +Working copy now at: pntkxysq d04ba185 (empty) (no description set) +Parent commit      : pmlzoorv 60ef6ed1 second | second +Added 0 files, modified 1 files, removed 0 files +$ cat file +third + +# Let's now instead make "second" and "third" +# sibling and merge them: -# Let's now instead make "second" and "third" -# sibling and merge them: - -$ jj rebase -s second -d first -Rebased 2 commits -Working copy now at: mqslnlrv 72803a85 (empty) (no description set) -Parent commit      : nrlsumvr 4b5d0b0d second | second -Added 0 files, modified 1 files, removed 0 files -$ jj merge second third -m merged -Working copy now at: xpkuouzp 7390c074 (empty) merged -Parent commit      : nrlsumvr 4b5d0b0d second | second -Parent commit      : ltqxzzvn 0aa4eff7 third | (conflict) third -Added 0 files, modified 1 files, removed 0 files -$ jj log -@    xpkuouzp jjfan@example.com 2023-10-01 22:29:22.561 -07:00 7390c074 -├─╮  (empty) merged -│ ◉  ltqxzzvn jjfan@example.com 2023-10-01 22:29:22.406 -07:00 third 0aa4eff7 -│ │  conflict -│ │  third -◉ │  nrlsumvr jjfan@example.com 2023-10-01 22:29:22.530 -07:00 second 4b5d0b0d -├─╯  second -◉  pumwmyut jjfan@example.com 2023-10-01 22:29:22.147 -07:00 first eb0ec5cc -│  first -◉  zzzzzzzz root() 00000000 - -# Again, because the merge commit has the -# changes from all three commits, it has no -# conflict. - +$ jj rebase -s second -d first +Rebased 2 commits +Working copy now at: pntkxysq 8e1a878a (empty) (no description set) +Parent commit      : pmlzoorv a4f3850e second | second +Added 0 files, modified 1 files, removed 0 files +$ jj merge second third -m merged +Working copy now at: trtwrukv 1b5ba1cc (empty) merged +Parent commit      : pmlzoorv a4f3850e second | second +Parent commit      : qsyokrkk ab068262 third | (conflict) third +Added 0 files, modified 1 files, removed 0 files +$ jj log +@    trtwrukv jjfan@example.com 2023-10-03 17:52:07.739 -07:00 1b5ba1cc +├─╮  (empty) merged +│ ◉  qsyokrkk jjfan@example.com 2023-10-03 17:52:07.583 -07:00 third ab068262 +│ │  conflict +│ │  third +◉ │  pmlzoorv jjfan@example.com 2023-10-03 17:52:07.708 -07:00 second a4f3850e +├─╯  second +◉  mzssttms jjfan@example.com 2023-10-03 17:52:07.312 -07:00 first c2cb2cfa +│  first +◉  zzzzzzzz root() 00000000 + +# Again, because the merge commit has the +# changes from all three commits, it has no +# conflict. + diff --git a/demos/operation_log.svg b/demos/operation_log.svg index f3ea2aa8c..3d6423bb1 100644 --- a/demos/operation_log.svg +++ b/demos/operation_log.svg @@ -1,5 +1,5 @@ - + - + # We are in the octocat/Hello-World repo. @@ -41,15 +41,15 @@ # so far: $ jj op log -@  fa79b3466874 jjfan@jujube now, lasted 1 millisecond +@  845481e61aaa jjfan@jujube now, lasted 1 millisecond │  check out git remote's default branch │  args: jj git clone https://github.com/octocat/Hello-World -◉  b9f3854e4c6b jjfan@jujube now, lasted 444 milliseconds +◉  f8c5a185ca4c jjfan@jujube now, lasted 392 milliseconds │  fetch from git remote into empty repo │  args: jj git clone https://github.com/octocat/Hello-World -◉  3eed56af5757 jjfan@jujube now, lasted less than a microsecond +◉  5c7d32912b0b jjfan@jujube now, lasted 1 millisecond │  add workspace 'default' -◉  6f3495125bc8 jjfan@jujube now, lasted less than a microsecond +◉  0fdc6a086c35 jjfan@jujube now, lasted less than a microsecond    initialize repo # We are going to make some changes to show @@ -58,12 +58,12 @@ $ echo stuff > new-file $ jj describe -m stuff -Working copy now at: xtrplzoo eb5aa286 stuff +Working copy now at: stlkvnrx ab94989a stuff Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr om Spaceghost/patch-1 $ jj rebase -d test Rebased 1 commits -Working copy now at: xtrplzoo 8c520228 stuff +Working copy now at: stlkvnrx 47f07ef4 stuff Parent commit      : kowxouwz b3cbd5bb test | Create CONTRIBUTING.md Added 1 files, modified 0 files, removed 0 files @@ -71,104 +71,106 @@ # master: $ jj co master -Working copy now at: okqrllkp 7ce6d4fb (empty) (no description set) -Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr +Working copy now at: yuknqtsx f18fb500 (empty) (no description set) +Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr om Spaceghost/patch-1 Added 0 files, modified 0 files, removed 2 files $ jj describe -m "other stuff" -Working copy now at: okqrllkp 792d0b92 (empty) other stuff -Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr +Working copy now at: yuknqtsx 12e96f12 (empty) other stuff +Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr om Spaceghost/patch-1 # The repo now looks like this: $ jj log -@  okqrllkp jjfan@example.com 2023-10-01 22:29:23.000 -07:00 792d0b92 +@  yuknqtsx jjfan@example.com 2023-10-03 17:52:08.000 -07:00 12e96f12 │  (empty) other stuff │ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 ├─╯  octocat-patch-1 b1b3f972 │    sentence case -│ ◉  xtrplzoo jjfan@example.com 2023-10-01 22:29:23.000 -07:00 8c520228 +│ ◉  stlkvnrx jjfan@example.com 2023-10-03 17:52:08.000 -07:00 47f07ef4 │ │  stuff │ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb ├─╯  Create CONTRIBUTING.md -◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b +◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b │  (empty) Merge pull request #6 from Spaceghost/patch-1 ~ # The most recent portion of the operation log # is: -$ jj op log | head -@  5bae9d9b6a8a jjfan@jujube now, lasted 1 millisecond -│  describe commit 7ce6d4fb5acb6945fd0301187a03245b49fe6b71 +$ jj op log --limit 4 +@  0fac552f4f72 jjfan@jujube now, lasted 1 millisecond +│  describe commit f18fb50012d764655037a7bb4cee0172691e5681 │  args: jj describe -m 'other stuff' -◉  99a3111903cc jjfan@jujube now, lasted 1 millisecond +◉  dc729a65a24b jjfan@jujube now, lasted 1 millisecond │  check out commit 7fd1a60b01f91b314f59955a4e4d4e80d8edf11d │  args: jj co master -◉  5cdf49cce8a4 jjfan@jujube now, lasted 1 millisecond -│  rebase commit eb5aa28675c23f6664c1027aae91f13bf5e3c474 and descendants +◉  99af13f4bea1 jjfan@jujube now, lasted 1 millisecond +│  rebase commit ab94989ab0b20e569b934dcffba33e68ad780d2a and descendants │  args: jj rebase -d test -◉  74cd4da2188d jjfan@jujube now, lasted 1 millisecond - -# Let's undo that rebase operation: +◉  9cc7474d42a1 jjfan@jujube now, lasted 1 millisecond +│  describe commit 47b41c1661fc8428b0f03641cab2b7a08c439e6c +│  args: jj describe -m stuff -$ jj undo 5cdf4 +# Let's undo that rebase operation: -# Note that only the rebase was undone, and the -# subsequent "other stuff" change was not undone: - -$ jj log -@  okqrllkp jjfan@example.com 2023-10-01 22:29:23.000 -07:00 792d0b92 -│  (empty) other stuff -│ ◉  xtrplzoo jjfan@example.com 2023-10-01 22:29:23.000 -07:00 eb5aa286 -├─╯  stuff -│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 -├─╯  octocat-patch-1 b1b3f972 -│    sentence case -│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb -├─╯  Create CONTRIBUTING.md -◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b -│  (empty) Merge pull request #6 from Spaceghost/patch-1 -~ - -# We can also see what the repo looked like -# after the rebase operation: - -$ jj --at-op 5cdf4 log -@  xtrplzoo jjfan@example.com 2023-10-01 22:29:23.000 -07:00 8c520228 -│  stuff -◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb -│  Create CONTRIBUTING.md -│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 -├─╯  octocat-patch-1 b1b3f972 -│    sentence case -◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b -│  (empty) Merge pull request #6 from Spaceghost/patch-1 -~ - -# Let's say we instead want to go back to the -# state of the repo right after the rebase: - -$ jj op restore 5cdf4 -Working copy now at: xtrplzoo 8c520228 stuff -Parent commit      : kowxouwz b3cbd5bb test | Create CONTRIBUTING.md -Added 2 files, modified 0 files, removed 0 files - -# We're now back to before the "other stuff" -# change existed: - -$ jj log -@  xtrplzoo jjfan@example.com 2023-10-01 22:29:23.000 -07:00 8c520228 -│  stuff -◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb -│  Create CONTRIBUTING.md -│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 -├─╯  octocat-patch-1 b1b3f972 -│    sentence case -◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b -│  (empty) Merge pull request #6 from Spaceghost/patch-1 -~ +$ jj undo 99af1 + +# Note that only the rebase was undone, and the +# subsequent "other stuff" change was not undone: + +$ jj log +@  yuknqtsx jjfan@example.com 2023-10-03 17:52:08.000 -07:00 12e96f12 +│  (empty) other stuff +│ ◉  stlkvnrx jjfan@example.com 2023-10-03 17:52:08.000 -07:00 ab94989a +├─╯  stuff +│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 +├─╯  octocat-patch-1 b1b3f972 +│    sentence case +│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb +├─╯  Create CONTRIBUTING.md +◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b +│  (empty) Merge pull request #6 from Spaceghost/patch-1 +~ + +# We can also see what the repo looked like +# after the rebase operation: + +$ jj --at-op 99af1 log +@  stlkvnrx jjfan@example.com 2023-10-03 17:52:08.000 -07:00 47f07ef4 +│  stuff +◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb +│  Create CONTRIBUTING.md +│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 +├─╯  octocat-patch-1 b1b3f972 +│    sentence case +◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b +│  (empty) Merge pull request #6 from Spaceghost/patch-1 +~ + +# Let's say we instead want to go back to the +# state of the repo right after the rebase: + +$ jj op restore 99af1 +Working copy now at: stlkvnrx 47f07ef4 stuff +Parent commit      : kowxouwz b3cbd5bb test | Create CONTRIBUTING.md +Added 2 files, modified 0 files, removed 0 files + +# We're now back to before the "other stuff" +# change existed: + +$ jj log +@  stlkvnrx jjfan@example.com 2023-10-03 17:52:08.000 -07:00 47f07ef4 +│  stuff +◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb +│  Create CONTRIBUTING.md +│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 +├─╯  octocat-patch-1 b1b3f972 +│    sentence case +◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b +│  (empty) Merge pull request #6 from Spaceghost/patch-1 +~ diff --git a/demos/resolve_conflicts.svg b/demos/resolve_conflicts.svg index 50d3b466f..e1203e096 100644 --- a/demos/resolve_conflicts.svg +++ b/demos/resolve_conflicts.svg @@ -1,5 +1,5 @@ - + - + # We are on the master branch of the # octocat/Hello-World repo: $ jj log -r 'all()' -@  xkmnkqsr jjfan@example.com 2023-10-01 22:29:25.000 -07:00 b6aec352 +@  nrtkvytr jjfan@example.com 2023-10-03 17:52:10.000 -07:00 5863a062 │  (empty) (no description set) │ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 ├─╯  octocat-patch-1 b1b3f972 @@ -49,10 +49,10 @@ ├─╯  Create CONTRIBUTING.md ◉    orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b ├─╮  (empty) Merge pull request #6 from Spaceghost/patch-1 -│ ◉  nznozkvv Johnneylee.rollins@gmail.com 2011-09-13 21:42:41.000 -07:00 +│ ◉  nznozkvv Johnneylee.rollins@gmail.com 2011-09-13 21:42:41.000 -07:00 ├─╯  76294131 │    New line at end of file. --Signed off by Spaceghost -◉  syktoqts cameron@github.com 2011-01-26 11:06:08.000 -08:00 553c2077 +◉  syktoqts cameron@github.com 2011-01-26 11:06:08.000 -08:00 553c2077 │  first commit ◉  zzzzzzzz root() 00000000 @@ -60,7 +60,7 @@ # when we rebase it: $ jj describe -m "README: say which world" -Working copy now at: xkmnkqsr 20110a7f (empty) README: say which world +Working copy now at: nrtkvytr 9c88f5a5 (empty) README: say which world Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr om Spaceghost/patch-1 $ echo "Hello Earth!" > README @@ -79,15 +79,15 @@ $ jj rebase -d b1 Rebased 1 commits -Working copy now at: xkmnkqsr 539b71db (conflict) README: say which world +Working copy now at: nrtkvytr 9333ce62 (conflict) README: say which world Parent commit      : tpstlust b1b3f972 octocat-patch-1 | sentence case Added 0 files, modified 1 files, removed 0 files -# Huh, that seemed to succeed. Let's take a -# look at the repo: +# That seemed to succeed but we are also told there is now a conflict. +# Let's take a look at the repo: $ jj log -r 'all()' -@  xkmnkqsr jjfan@example.com 2023-10-01 22:29:25.000 -07:00 539b71db conflict +@  nrtkvytr jjfan@example.com 2023-10-03 17:52:10.000 -07:00 9333ce62 conflict │  README: say which world ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 │  octocat-patch-1 b1b3f972 @@ -96,7 +96,7 @@ ├─╯  Create CONTRIBUTING.md ◉    orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b ├─╮  (empty) Merge pull request #6 from Spaceghost/patch-1 -│ ◉  nznozkvv Johnneylee.rollins@gmail.com 2011-09-13 21:42:41.000 -07:00 +│ ◉  nznozkvv Johnneylee.rollins@gmail.com 2011-09-13 21:42:41.000 -07:00 ├─╯  76294131 │    New line at end of file. --Signed off by Spaceghost ◉  syktoqts cameron@github.com 2011-01-26 11:06:08.000 -08:00 553c2077 @@ -107,33 +107,32 @@ M README There are unresolved conflicts at these paths: README    2-sided conflict -Working copy : xkmnkqsr 539b71db (conflict) README: say which world +Working copy : nrtkvytr 9333ce62 (conflict) README: say which world Parent commit: tpstlust b1b3f972 octocat-patch-1 | sentence case -# As you can see, the rebased commit has a -# conflict. The file in the working copy looks -# like this: - -$ cat README -<<<<<<< -%%%%%%% --Hello World! -+Hello world! -+++++++ -Hello Earth! ->>>>>>> - -# Now we will resolve the conflict: - -$ echo "Hello earth!" > README - -# The status command no longer reports it: - -$ jj status -Working copy changes: -M README -Working copy : xkmnkqsr b1c13c23 README: say which world -Parent commit: tpstlust b1b3f972 octocat-patch-1 | sentence case +# Indeed, the rebased commit has a conflict. The conflicted file +# in the working copy looks like this: + +$ cat README +<<<<<<< +%%%%%%% +-Hello World! ++Hello world! ++++++++ +Hello Earth! +>>>>>>> + +# Now we will resolve the conflict: + +$ echo "Hello earth!" > README + +# The status command no longer reports it: + +$ jj status +Working copy changes: +M README +Working copy : nrtkvytr db55fbbe README: say which world +Parent commit: tpstlust b1b3f972 octocat-patch-1 | sentence case diff --git a/demos/working_copy.svg b/demos/working_copy.svg index 9b0d36b3e..dd5983475 100644 --- a/demos/working_copy.svg +++ b/demos/working_copy.svg @@ -1,5 +1,5 @@ - + - + # We are in the octocat/Hello-World repo. # We have an empty working copy on top of master: -$ jj status -The working copy is clean -Working copy : mxqlopuw 8d0e7e7c (empty) (no description set) -Parent commit: orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spa -ceghost/patch-1 -$ jj log -@  mxqlopuw jjfan@example.com 2023-10-01 22:29:26.000 -07:00 8d0e7e7c -│  (empty) (no description set) -│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 -├─╯  octocat-patch-1 b1b3f972 -│    sentence case -│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb -├─╯  Create CONTRIBUTING.md -◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b -│  (empty) Merge pull request #6 from Spaceghost/patch-1 -~ +$ jj log +@  vqulumvq jjfan@example.com 2023-10-03 17:52:11.000 -07:00 58432c48 +│  (empty) (no description set) +│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 +├─╯  octocat-patch-1 b1b3f972 +│    sentence case +│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb +├─╯  Create CONTRIBUTING.md +◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b +│  (empty) Merge pull request #6 from Spaceghost/patch-1 +~ +$ jj status +The working copy is clean +Working copy : vqulumvq 58432c48 (empty) (no description set) +Parent commit: orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spa +ceghost/patch-1 # Now make some changes in the working copy: $ echo "Goodbye World!" > README $ echo stuff > new-file -# Our working copy's commit ID changed -# because we made changes: +# Because of these changes, our working copy is no longer marked as "(empty)". +# Also, its commit ID (starting with a blue character) changed: $ jj status Working copy changes: M README A new-file -Working copy : mxqlopuw b580fc4d (no description set) +Working copy : vqulumvq 25610674 (no description set) Parent commit: orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spa ceghost/patch-1 -$ jj log -@  mxqlopuw jjfan@example.com 2023-10-01 22:29:27.000 -07:00 b580fc4d -│  (no description set) -│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 -├─╯  octocat-patch-1 b1b3f972 -│    sentence case -│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb -├─╯  Create CONTRIBUTING.md -◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b -│  (empty) Merge pull request #6 from Spaceghost/patch-1 -~ - -# Add a branch so we can easily refer to this -# commit: - -$ jj branch create goodbye -$ jj log -@  mxqlopuw jjfan@example.com 2023-10-01 22:29:27.000 -07:00 goodbye b580fc4d -│  (no description set) -│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 -├─╯  octocat-patch-1 b1b3f972 -│    sentence case -│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb -├─╯  Create CONTRIBUTING.md -◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b -│  (empty) Merge pull request #6 from Spaceghost/patch-1 -~ + +# Add a branch so we can easily refer to this +# commit: + +$ jj branch create goodbye +$ jj log +@  vqulumvq jjfan@example.com 2023-10-03 17:52:11.000 -07:00 goodbye 25610674 +│  (no description set) +│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 +├─╯  octocat-patch-1 b1b3f972 +│    sentence case +│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb +├─╯  Create CONTRIBUTING.md +◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b +│  (empty) Merge pull request #6 from Spaceghost/patch-1 +~ + +# Start working on a new change off of master: + +$ jj co master +Working copy now at: tqwqmnqp e5047385 (empty) (no description set) +Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr +om Spaceghost/patch-1 +Added 0 files, modified 1 files, removed 1 files + +# Note that we were told the working copy is now empty (AKA clean). The +# "goodbye" change stayed in its own commit: -# Start working on a new change off of master: - -$ jj co master -Working copy now at: quqqqrtm cb2e4d75 (empty) (no description set) -Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr -om Spaceghost/patch-1 -Added 0 files, modified 1 files, removed 1 files -$ jj log -@  quqqqrtm jjfan@example.com 2023-10-01 22:29:27.000 -07:00 cb2e4d75 -│  (empty) (no description set) -│ ◉  mxqlopuw jjfan@example.com 2023-10-01 22:29:27.000 -07:00 goodbye b580fc4d -├─╯  (no description set) -│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 -├─╯  octocat-patch-1 b1b3f972 -│    sentence case -│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb -├─╯  Create CONTRIBUTING.md -◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b -│  (empty) Merge pull request #6 from Spaceghost/patch-1 -~ - -# Note that the working copy is now clean; the -# "goodbye" change stayed in its own commit: - -$ jj status -The working copy is clean -Working copy : quqqqrtm cb2e4d75 (empty) (no description set) -Parent commit: orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spa -ceghost/patch-1 - -# Modify a file in this new change: - -$ echo "Hello everyone!" > README - -# The working copy is not special; we can, for -# example, set the description of any commit. -# First, set it on the working copy: - -$ jj describe -m everyone -Working copy now at: quqqqrtm 50e8e102 everyone -Parent commit      : orrkosyo 7fd1a60b master | (empty) Merge pull request #6 fr -om Spaceghost/patch-1 - -# Now set it on the change we worked on before: - -$ jj describe goodbye -m goodbye - -# Inspect the result: - -$ jj log -◉  mxqlopuw jjfan@example.com 2023-10-01 22:29:27.000 -07:00 goodbye b19dd123 -│  goodbye -│ @  quqqqrtm jjfan@example.com 2023-10-01 22:29:27.000 -07:00 50e8e102 -├─╯  everyone -│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 -├─╯  octocat-patch-1 b1b3f972 -│    sentence case -│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb -├─╯  Create CONTRIBUTING.md -◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b -│  (empty) Merge pull request #6 from Spaceghost/patch-1 -~ +$ jj log +@  tqwqmnqp jjfan@example.com 2023-10-03 17:52:10.000 -07:00 e5047385 +│  (empty) (no description set) +│ ◉  vqulumvq jjfan@example.com 2023-10-03 17:52:11.000 -07:00 goodbye 25610674 +├─╯  (no description set) +│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 +├─╯  octocat-patch-1 b1b3f972 +│    sentence case +│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb +├─╯  Create CONTRIBUTING.md +◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b +│  (empty) Merge pull request #6 from Spaceghost/patch-1 +~ + +# Let's do a sanity check: 'jj status' should tell us that +# the working copy is clean. + +$ jj status +The working copy is clean +Working copy : tqwqmnqp e5047385 (empty) (no description set) +Parent commit: orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spa +ceghost/patch-1 + +# Modify a file in this new change: + +$ echo "Hello everyone!" > README +$ jj status +Working copy changes: +M README +Working copy : tqwqmnqp e2f75adb (no description set) +Parent commit: orrkosyo 7fd1a60b master | (empty) Merge pull request #6 from Spa +ceghost/patch-1 + +# The working copy is not special; we can, for +# example, set the description of any commit. +# First, set it on the working copy: + +$ jj describe -m everyone +... (output redacted) ... + +# Now set it on the change we worked on before: + +$ jj describe goodbye -m goodbye + +# Inspect the result: + +$ jj log +◉  vqulumvq jjfan@example.com 2023-10-03 17:52:11.000 -07:00 goodbye acfe0ad3 +│  goodbye +│ @  tqwqmnqp jjfan@example.com 2023-10-03 17:52:11.000 -07:00 7d1af3d0 +├─╯  everyone +│ ◉  tpstlust support+octocat@github.com 2018-05-10 12:55:19.000 -05:00 +├─╯  octocat-patch-1 b1b3f972 +│    sentence case +│ ◉  kowxouwz octocat@nowhere.com 2014-06-10 15:22:26.000 -07:00 test b3cbd5bb +├─╯  Create CONTRIBUTING.md +◉  orrkosyo octocat@nowhere.com 2012-03-06 15:06:50.000 -08:00 master 7fd1a60b +│  (empty) Merge pull request #6 from Spaceghost/patch-1 +~