Skip to content

Commit

Permalink
docs: update to use new jj branch syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonz committed Jun 10, 2022
1 parent e8e0388 commit a15192c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ working copy or any other commit. It also means that you can always check out a
different commit without first explicitly committing the working copy changes
(you can even check out a different commit while resolving merge conflicts).

<a href="https://asciinema.org/a/OywNvPxShG4Zmul2eNcDiL3nj" target="_blank">
<img src="https://asciinema.org/a/OywNvPxShG4Zmul2eNcDiL3nj.svg" />
<a href="https://asciinema.org/a/XVJwcGbZek4cfk3510iQdloD8" target="_blank">
<img src="https://asciinema.org/a/XVJwcGbZek4cfk3510iQdloD8.svg" />
</a>

### Operations update the repo first, then possibly the working copy
Expand Down Expand Up @@ -97,8 +97,8 @@ Basic conflict resolution:
</a>

Juggling conflicts:
<a href="https://asciinema.org/a/sTQnMCthulo2NfwRnHX30qegq" target="_blank">
<img src="https://asciinema.org/a/sTQnMCthulo2NfwRnHX30qegq.svg" />
<a href="https://asciinema.org/a/efo1dbUuERDnDk1igaVi9TZVb" target="_blank">
<img src="https://asciinema.org/a/efo1dbUuERDnDk1igaVi9TZVb.svg" />
</a>

### Automatic rebase
Expand Down
6 changes: 3 additions & 3 deletions demos/demo_juggle_conflicts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ parse_args "$@"
new_tmp_dir
jj init
echo "first" > file
jj branch first
jj branch create first
jj close -m 'first'
echo "second" > file
jj branch second
jj branch create second
jj close -m 'second'
echo "third" > file
jj branch third
jj branch create third
jj close -m 'third'

run_demo 'Juggling conflicts' '
Expand Down
2 changes: 1 addition & 1 deletion demos/demo_working_copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ run_command "jj log"
pause 5
run_command "# Add a branch so we can easily refer to this"
run_command "# commit:"
run_command "jj branch goodbye"
run_command "jj branch create goodbye"
pause 2
run_command "jj log"
pause 3
Expand Down
6 changes: 3 additions & 3 deletions docs/branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ move them without affecting the target revision's identity. Branches
automatically move when revisions are rewritten (e.g. by `jj rebase`). You can
pass a branch's name to commands that want a revision as argument. For example,
`jj co main` will check out the revision pointed to by the "main" branch. Use
`jj branches` to list branches and `jj branch` to create, move, or delete
`jj branch list` to list branches and `jj branch` to create, move, or delete
branches. There is currently no concept of an active/current/checked-out branch.


Expand All @@ -34,7 +34,7 @@ remote's state will be propagated to the local branch. Let's say you run
target is now ahead of the local record in `main@origin`. That will update
`main@origin` to the new target. It will also apply the change to the local
branch `main`. If the local target had also moved compared to `main@origin`
(probably because you had run `jj branch main`), then the two updates will be
(probably because you had run `jj branch set main`), then the two updates will be
merged. If one is ahead of the other, then that target will be the new target.
Otherwise, the local branch will be conflicted (see next section for details).

Expand All @@ -43,7 +43,7 @@ Otherwise, the local branch will be conflicted (see next section for details).

Branches can end up in a conflicted state. When that happens, `jj status` will
include information about the conflicted branches (and instructions for how to
mitigate it). `jj branches` will have details. `jj log` will show the branch
mitigate it). `jj branch list` will have details. `jj log` will show the branch
name with a question mark suffix (e.g. `main?`) on each of the conflicted
branch's potential target revisions. Using the branch name to look up a revision
will resolve to all potential targets. That means that `jj co main` will error
Expand Down
10 changes: 5 additions & 5 deletions docs/git-comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,27 +259,27 @@ parent.
</tr>
<tr>
<td>List branches</td>
<td><code>jj branches</code></td>
<td><code>jj branch list</code></td>
<td><code>git branch</code></td>
</tr>
<tr>
<td>Create a branch</td>
<td><code>jj branch &lt;name&gt; -r &lt;revision&gt;</code></td>
<td><code>jj branch create &lt;name&gt; -r &lt;revision&gt;</code></td>
<td><code>git branch &lt;name&gt; &lt;revision&gt;</code></td>
</tr>
<tr>
<td>Move a branch forward</td>
<td><code>jj branch &lt;name&gt; -r &lt;revision&gt;</code></td>
<td><code>jj branch set &lt;name&gt; -r &lt;revision&gt;</code></td>
<td><code>git branch -f &lt;name&gt; &lt;revision&gt;</code></td>
</tr>
<tr>
<td>Move a branch backward or sideways</td>
<td><code>jj branch &lt;name&gt; -r &lt;revision&gt; --allow-backwards</code></td>
<td><code>jj branch set &lt;name&gt; -r &lt;revision&gt; --allow-backwards</code></td>
<td><code>git branch -f &lt;name&gt; &lt;revision&gt;</code></td>
</tr>
<tr>
<td>Delete a branch</td>
<td><code>jj branch --delete &lt;name&gt; </code></td>
<td><code>jj branch delete &lt;name&gt; </code></td>
<td><code>git branch --delete &lt;name&gt;</code></td>
</tr>
<tr>
Expand Down
5 changes: 3 additions & 2 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2919,7 +2919,8 @@ fn cmd_status(
}
writeln!(
ui,
" Use `jj branches` to see details. Use `jj branch <name> -r <rev>` to resolve."
" Use `jj branch list` to see details. Use `jj branch set <name> -r <rev>` to \
resolve."
)?;
}
if !conflicted_remote_branches.is_empty() {
Expand All @@ -2935,7 +2936,7 @@ fn cmd_status(
}
writeln!(
ui,
" Use `jj branches` to see details. Use `jj git pull` to resolve."
" Use `jj branch list` to see details. Use `jj git pull` to resolve."
)?;
}

Expand Down

0 comments on commit a15192c

Please sign in to comment.