forked from mirrors/jj
docs: change "shell script" codeblock to "shell"
```shell script ``` breaks mkdocs rendering
This commit is contained in:
parent
64140c34b7
commit
623c5e28c2
3 changed files with 41 additions and 41 deletions
|
@ -14,7 +14,7 @@ authenticated http.
|
||||||
The simplest way to start with Jujutsu, is creating a stack of commits, before
|
The simplest way to start with Jujutsu, is creating a stack of commits, before
|
||||||
creating any branch.
|
creating any branch.
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
# Start a new commit off of `main`
|
# Start a new commit off of `main`
|
||||||
$ jj new main
|
$ jj new main
|
||||||
# Refactor some files, then add a description and start a new commit
|
# Refactor some files, then add a description and start a new commit
|
||||||
|
@ -45,7 +45,7 @@ branches. In a co-located repository, `jj` isn't the source of truth. But
|
||||||
Jujutsu allows an incremental migration, as `jj commit` updates the HEAD of the
|
Jujutsu allows an incremental migration, as `jj commit` updates the HEAD of the
|
||||||
git repository.
|
git repository.
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
$ nvim docs/tutorial.md
|
$ nvim docs/tutorial.md
|
||||||
$ # Do some more work.
|
$ # Do some more work.
|
||||||
$ jj commit -m "Update tutorial"
|
$ jj commit -m "Update tutorial"
|
||||||
|
@ -61,7 +61,7 @@ In a Jujutsu repository, the workflow is simplified. If there's no need for
|
||||||
explicitly named branches, you just can generate one for a change. As Jujutsu is
|
explicitly named branches, you just can generate one for a change. As Jujutsu is
|
||||||
able to create a branch for a revision.
|
able to create a branch for a revision.
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
$ # Do your work
|
$ # Do your work
|
||||||
$ jj commit
|
$ jj commit
|
||||||
$ # Jujutsu automatically creates a branch
|
$ # Jujutsu automatically creates a branch
|
||||||
|
@ -81,7 +81,7 @@ force-pushing[^2].
|
||||||
If your project prefers that you address review comments by adding commits on
|
If your project prefers that you address review comments by adding commits on
|
||||||
top, you can do that by doing something like this:
|
top, you can do that by doing something like this:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
$ # Create a new commit on top of the `your-feature` branch from above.
|
$ # Create a new commit on top of the `your-feature` branch from above.
|
||||||
$ jj new your-feature
|
$ jj new your-feature
|
||||||
$ # Address the comments, by updating the code
|
$ # Address the comments, by updating the code
|
||||||
|
@ -99,7 +99,7 @@ $ jj git push.
|
||||||
If your project prefers that you keep commits clean, you can do that by doing
|
If your project prefers that you keep commits clean, you can do that by doing
|
||||||
something like this:
|
something like this:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
$ # Create a new commit on top of the second-to-last commit in `your-feature`,
|
$ # Create a new commit on top of the second-to-last commit in `your-feature`,
|
||||||
$ # as reviews requested a fix there.
|
$ # as reviews requested a fix there.
|
||||||
$ jj new your-feature-
|
$ jj new your-feature-
|
||||||
|
|
|
@ -16,13 +16,13 @@ On most distributions, you'll need to build from source using `cargo` directly.
|
||||||
First make sure that you have the `libssl-dev`, `openssl`, and `pkg-config`
|
First make sure that you have the `libssl-dev`, `openssl`, and `pkg-config`
|
||||||
packages installed by running something like this:
|
packages installed by running something like this:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
sudo apt-get install libssl-dev openssl pkg-config
|
sudo apt-get install libssl-dev openssl pkg-config
|
||||||
```
|
```
|
||||||
|
|
||||||
Now run:
|
Now run:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
cargo install --git https://github.com/martinvonz/jj.git --locked --bin jj jj-cli
|
cargo install --git https://github.com/martinvonz/jj.git --locked --bin jj jj-cli
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -31,14 +31,14 @@ cargo install --git https://github.com/martinvonz/jj.git --locked --bin jj jj-cl
|
||||||
If you're on Nix OS you can use the flake for this repository.
|
If you're on Nix OS you can use the flake for this repository.
|
||||||
For example, if you want to run `jj` loaded from the flake, use:
|
For example, if you want to run `jj` loaded from the flake, use:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
nix run 'github:martinvonz/jj'
|
nix run 'github:martinvonz/jj'
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also add this flake url to your system input flakes. Or you can
|
You can also add this flake url to your system input flakes. Or you can
|
||||||
install the flake to your user profile:
|
install the flake to your user profile:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
nix profile install 'github:martinvonz/jj'
|
nix profile install 'github:martinvonz/jj'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ nix profile install 'github:martinvonz/jj'
|
||||||
|
|
||||||
If you use linuxbrew, you can run:
|
If you use linuxbrew, you can run:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
brew install jj
|
brew install jj
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ brew install jj
|
||||||
|
|
||||||
If you use Homebrew, you can run:
|
If you use Homebrew, you can run:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
brew install jj
|
brew install jj
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ brew install jj
|
||||||
You can also install `jj` via [MacPorts](https://www.macports.org) (as
|
You can also install `jj` via [MacPorts](https://www.macports.org) (as
|
||||||
the `jujutsu` port):
|
the `jujutsu` port):
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
sudo port install jujutsu
|
sudo port install jujutsu
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ sudo port install jujutsu
|
||||||
|
|
||||||
You may need to run some or all of these:
|
You may need to run some or all of these:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
xcode-select --install
|
xcode-select --install
|
||||||
brew install openssl
|
brew install openssl
|
||||||
brew install pkg-config
|
brew install pkg-config
|
||||||
|
@ -84,7 +84,7 @@ export PKG_CONFIG_PATH="$(brew --prefix)/opt/openssl@3/lib/pkgconfig"
|
||||||
|
|
||||||
Now run:
|
Now run:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
cargo install --git https://github.com/martinvonz/jj.git --locked --bin jj jj-cli
|
cargo install --git https://github.com/martinvonz/jj.git --locked --bin jj jj-cli
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ cargo install --git https://github.com/martinvonz/jj.git --locked --bin jj jj-cl
|
||||||
|
|
||||||
Run:
|
Run:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
cargo install --git https://github.com/martinvonz/jj.git --locked --bin jj jj-cli --features vendored-openssl
|
cargo install --git https://github.com/martinvonz/jj.git --locked --bin jj jj-cli --features vendored-openssl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ cargo install --git https://github.com/martinvonz/jj.git --locked --bin jj jj-cl
|
||||||
|
|
||||||
You may want to configure your name and email so commits are made in your name.
|
You may want to configure your name and email so commits are made in your name.
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
$ jj config set --user user.name "Martin von Zweigbergk"
|
$ jj config set --user user.name "Martin von Zweigbergk"
|
||||||
$ jj config set --user user.email "martinvonz@google.com"
|
$ jj config set --user user.email "martinvonz@google.com"
|
||||||
```
|
```
|
||||||
|
@ -113,19 +113,19 @@ jj <= 0.7.0). Exactly how to source it depends on your shell.
|
||||||
|
|
||||||
### Bash
|
### Bash
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
source <(jj util completion) # --bash is the default
|
source <(jj util completion) # --bash is the default
|
||||||
```
|
```
|
||||||
|
|
||||||
Or, with jj <= 0.7.0:
|
Or, with jj <= 0.7.0:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
source <(jj debug completion) # --bash is the default
|
source <(jj debug completion) # --bash is the default
|
||||||
```
|
```
|
||||||
|
|
||||||
### Zsh
|
### Zsh
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
autoload -U compinit
|
autoload -U compinit
|
||||||
compinit
|
compinit
|
||||||
source <(jj util completion --zsh)
|
source <(jj util completion --zsh)
|
||||||
|
@ -133,7 +133,7 @@ source <(jj util completion --zsh)
|
||||||
|
|
||||||
Or, with jj <= 0.7.0:
|
Or, with jj <= 0.7.0:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
autoload -U compinit
|
autoload -U compinit
|
||||||
compinit
|
compinit
|
||||||
source <(jj debug completion --zsh)
|
source <(jj debug completion --zsh)
|
||||||
|
@ -141,25 +141,25 @@ source <(jj debug completion --zsh)
|
||||||
|
|
||||||
### Fish
|
### Fish
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
jj util completion --fish | source
|
jj util completion --fish | source
|
||||||
```
|
```
|
||||||
|
|
||||||
Or, with jj <= 0.7.0:
|
Or, with jj <= 0.7.0:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
jj debug completion --fish | source
|
jj debug completion --fish | source
|
||||||
```
|
```
|
||||||
|
|
||||||
### Xonsh
|
### Xonsh
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
source-bash $(jj util completion)
|
source-bash $(jj util completion)
|
||||||
```
|
```
|
||||||
|
|
||||||
Or, with jj <= 0.7.0:
|
Or, with jj <= 0.7.0:
|
||||||
|
|
||||||
```shell script
|
```shell
|
||||||
source-bash $(jj debug completion)
|
source-bash $(jj debug completion)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ If you haven't already, make sure you
|
||||||
## Cloning a Git repo
|
## Cloning a Git repo
|
||||||
|
|
||||||
Let's start by cloning GitHub's Hello-World repo using `jj`:
|
Let's start by cloning GitHub's Hello-World repo using `jj`:
|
||||||
```shell script
|
```shell
|
||||||
# Note the "git" before "clone" (there is no support for cloning native jj
|
# Note the "git" before "clone" (there is no support for cloning native jj
|
||||||
# repos yet)
|
# repos yet)
|
||||||
$ jj git clone https://github.com/octocat/Hello-World
|
$ jj git clone https://github.com/octocat/Hello-World
|
||||||
|
@ -21,7 +21,7 @@ $ cd Hello-World
|
||||||
```
|
```
|
||||||
|
|
||||||
Running `jj st` (short for`jj status`) now yields something like this:
|
Running `jj st` (short for`jj status`) now yields something like this:
|
||||||
```shell script
|
```shell
|
||||||
$ jj st
|
$ jj st
|
||||||
Parent commit: 7fd1a60b01f9 Merge pull request #6 from Spaceghost/patch-1
|
Parent commit: 7fd1a60b01f9 Merge pull request #6 from Spaceghost/patch-1
|
||||||
Working copy : d7439b06fbef (no description set)
|
Working copy : d7439b06fbef (no description set)
|
||||||
|
@ -38,7 +38,7 @@ command.
|
||||||
Now let's say we want to edit the `README` file in the repo to say "Goodbye"
|
Now let's say we want to edit the `README` file in the repo to say "Goodbye"
|
||||||
instead of "Hello". Let's start by describing the change (adding a
|
instead of "Hello". Let's start by describing the change (adding a
|
||||||
commit message) so we don't forget what we're working on:
|
commit message) so we don't forget what we're working on:
|
||||||
```shell script
|
```shell
|
||||||
# This will bring up $EDITOR (or `pico` or `Notepad` by default). Enter
|
# This will bring up $EDITOR (or `pico` or `Notepad` by default). Enter
|
||||||
# something like "Say goodbye" in the editor and then save the file and close
|
# something like "Say goodbye" in the editor and then save the file and close
|
||||||
# the editor.
|
# the editor.
|
||||||
|
@ -47,7 +47,7 @@ Working copy now at: e427edcfd0ba Say goodbye
|
||||||
```
|
```
|
||||||
|
|
||||||
Now make the change in the README:
|
Now make the change in the README:
|
||||||
```shell script
|
```shell
|
||||||
# Adjust as necessary for compatibility with your flavor of `sed`
|
# Adjust as necessary for compatibility with your flavor of `sed`
|
||||||
$ sed -i 's/Hello/Goodbye/' README
|
$ sed -i 's/Hello/Goodbye/' README
|
||||||
$ jj st
|
$ jj st
|
||||||
|
@ -62,7 +62,7 @@ remove existing files. To untrack a path, add it to your `.gitignore` and run
|
||||||
`jj untrack <path>`.
|
`jj untrack <path>`.
|
||||||
|
|
||||||
To see the diff, run `jj diff`:
|
To see the diff, run `jj diff`:
|
||||||
```shell script
|
```shell
|
||||||
$ jj diff --git # Feel free to skip the `--git` flag
|
$ jj diff --git # Feel free to skip the `--git` flag
|
||||||
diff --git a/README b/README
|
diff --git a/README b/README
|
||||||
index 980a0d5f19...1ce3f81130 100644
|
index 980a0d5f19...1ce3f81130 100644
|
||||||
|
@ -87,7 +87,7 @@ VCSs, there is also a `jj checkout/co` command, which is practically a synonym
|
||||||
for `jj new` (you can specify a destination for `jj new` as well).
|
for `jj new` (you can specify a destination for `jj new` as well).
|
||||||
|
|
||||||
So, let's say we're now done with this change, so we create a new change:
|
So, let's say we're now done with this change, so we create a new change:
|
||||||
```shell script
|
```shell
|
||||||
$ jj new
|
$ jj new
|
||||||
Working copy now at: aef4df99ea11 (no description set)
|
Working copy now at: aef4df99ea11 (no description set)
|
||||||
$ jj st
|
$ jj st
|
||||||
|
@ -114,7 +114,7 @@ sense to use `jj checkout` so you can easily review your adjustments with
|
||||||
|
|
||||||
You're probably familiar with `git log`. Jujutsu has very similar functionality
|
You're probably familiar with `git log`. Jujutsu has very similar functionality
|
||||||
in its `jj log` command:
|
in its `jj log` command:
|
||||||
```shell script
|
```shell
|
||||||
$ jj log
|
$ jj log
|
||||||
@ mpqrykypylvy martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99ea11
|
@ mpqrykypylvy martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99ea11
|
||||||
│ (empty) (no description set)
|
│ (empty) (no description set)
|
||||||
|
@ -141,7 +141,7 @@ refers to the working-copy commit, `root` refers to the root commit,
|
||||||
`branches()` refers to all commits pointed to by branches. We can combine
|
`branches()` refers to all commits pointed to by branches. We can combine
|
||||||
expressions with `|` for union, `&` for intersection and `~` for difference. For
|
expressions with `|` for union, `&` for intersection and `~` for difference. For
|
||||||
example:
|
example:
|
||||||
```shell script
|
```shell
|
||||||
$ jj log -r '@ | root | branches()'
|
$ jj log -r '@ | root | branches()'
|
||||||
@ mpqrykypylvy martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99ea11
|
@ mpqrykypylvy martinvonz@google.com 2023-02-12 15:00:22.000 -08:00 aef4df99ea11
|
||||||
╷ (empty) (no description set)
|
╷ (empty) (no description set)
|
||||||
|
@ -169,7 +169,7 @@ input set if they're ancestors of other revisions in the set.
|
||||||
|
|
||||||
Now let's see how Jujutsu deals with merge conflicts. We'll start by making some
|
Now let's see how Jujutsu deals with merge conflicts. We'll start by making some
|
||||||
commits:
|
commits:
|
||||||
```shell script
|
```shell
|
||||||
# Start creating a chain of commits off of the `master` branch
|
# Start creating a chain of commits off of the `master` branch
|
||||||
$ jj new master -m A; echo a > file1
|
$ jj new master -m A; echo a > file1
|
||||||
Working copy now at: 00a2aeed556a A
|
Working copy now at: 00a2aeed556a A
|
||||||
|
@ -198,7 +198,7 @@ $ jj log
|
||||||
|
|
||||||
We now have a few commits, where A, B1, and B2 modify the same file, while C
|
We now have a few commits, where A, B1, and B2 modify the same file, while C
|
||||||
modifies a different file. Let's now rebase B2 directly onto A:
|
modifies a different file. Let's now rebase B2 directly onto A:
|
||||||
```shell script
|
```shell
|
||||||
$ jj rebase -s puqltuttrvzp -d nuvyytnqlquo
|
$ jj rebase -s puqltuttrvzp -d nuvyytnqlquo
|
||||||
Rebased 2 commits
|
Rebased 2 commits
|
||||||
Working copy now at: 1978b53430cd C
|
Working copy now at: 1978b53430cd C
|
||||||
|
@ -230,7 +230,7 @@ from getting rebased on top.
|
||||||
Now let's resolve the conflict in B2. We'll do that by creating a new commit on
|
Now let's resolve the conflict in B2. We'll do that by creating a new commit on
|
||||||
top of B2. Once we've resolved the conflict, we'll squash the conflict
|
top of B2. Once we've resolved the conflict, we'll squash the conflict
|
||||||
resolution into the conflicted B2. That might look like this:
|
resolution into the conflicted B2. That might look like this:
|
||||||
```shell script
|
```shell
|
||||||
$ jj new puqltuttrvzp # Replace the ID by what you have for B2
|
$ jj new puqltuttrvzp # Replace the ID by what you have for B2
|
||||||
Working copy now at: c7068d1c23fd (no description set)
|
Working copy now at: c7068d1c23fd (no description set)
|
||||||
Added 0 files, modified 0 files, removed 1 files
|
Added 0 files, modified 0 files, removed 1 files
|
||||||
|
@ -282,7 +282,7 @@ descendants to its parent.
|
||||||
Jujutsu keeps a record of all changes you've made to the repo in what's called
|
Jujutsu keeps a record of all changes you've made to the repo in what's called
|
||||||
the "operation log". Use the `jj op` (short for `jj operation`) family of
|
the "operation log". Use the `jj op` (short for `jj operation`) family of
|
||||||
commands to interact with it. To list the operations, use `jj op log`:
|
commands to interact with it. To list the operations, use `jj op log`:
|
||||||
```shell script
|
```shell
|
||||||
$ jj op log
|
$ jj op log
|
||||||
@ d3b77addea49 martinvonz@vonz.svl.corp.google.com 2023-02-12 19:34:09.549 -08:00 - 2023-02-12 19:34:09.552 -08:00
|
@ d3b77addea49 martinvonz@vonz.svl.corp.google.com 2023-02-12 19:34:09.549 -08:00 - 2023-02-12 19:34:09.552 -08:00
|
||||||
│ squash commit 63874fe6c4fba405ffc38b0dd926f03b715cf7ef
|
│ squash commit 63874fe6c4fba405ffc38b0dd926f03b715cf7ef
|
||||||
|
@ -300,7 +300,7 @@ $ jj op log
|
||||||
|
|
||||||
The most useful command is `jj undo` (alias for `jj op undo`), which will undo
|
The most useful command is `jj undo` (alias for `jj op undo`), which will undo
|
||||||
an operation. By default, it will undo the most recent operation. Let's try it:
|
an operation. By default, it will undo the most recent operation. Let's try it:
|
||||||
```shell script
|
```shell
|
||||||
$ jj undo
|
$ jj undo
|
||||||
Working copy now at: 63874fe6c4fb (no description set)
|
Working copy now at: 63874fe6c4fb (no description set)
|
||||||
$ jj log
|
$ jj log
|
||||||
|
@ -338,7 +338,7 @@ can [configure `scm-diff-editor`](config.md#setting-up-scm-diff-editor) instead.
|
||||||
|
|
||||||
We'll need some more complex content to test these commands, so let's create a
|
We'll need some more complex content to test these commands, so let's create a
|
||||||
few more commits:
|
few more commits:
|
||||||
```shell script
|
```shell
|
||||||
$ jj new master -m abc; printf 'a\nb\nc\n' > file
|
$ jj new master -m abc; printf 'a\nb\nc\n' > file
|
||||||
Working copy now at: f94e49cf2547 abc
|
Working copy now at: f94e49cf2547 abc
|
||||||
Added 0 files, modified 0 files, removed 1 files
|
Added 0 files, modified 0 files, removed 1 files
|
||||||
|
@ -365,7 +365,7 @@ that by running `jj squash -i` (short for `jj squash --interactive`) on the
|
||||||
third commit. Remember that `jj squash` moves all the changes from one commit
|
third commit. Remember that `jj squash` moves all the changes from one commit
|
||||||
into its parent. `jj squash -i` moves only part of the changes into its parent.
|
into its parent. `jj squash -i` moves only part of the changes into its parent.
|
||||||
Now try that:
|
Now try that:
|
||||||
```shell script
|
```shell
|
||||||
$ jj squash -i
|
$ jj squash -i
|
||||||
Using default editor 'meld'; you can change this by setting ui.diff-editor
|
Using default editor 'meld'; you can change this by setting ui.diff-editor
|
||||||
Working copy now at: 52a6c7fda1e3 ABCD
|
Working copy now at: 52a6c7fda1e3 ABCD
|
||||||
|
@ -374,7 +374,7 @@ That will bring up Meld with a diff of the changes in the "ABCD" commit. Modify
|
||||||
the right side of the diff to have the desired end state in "ABC" by removing
|
the right side of the diff to have the desired end state in "ABC" by removing
|
||||||
the "D" line. Then save the changes and close Meld. If we look at the diff of
|
the "D" line. Then save the changes and close Meld. If we look at the diff of
|
||||||
the second commit, we now see that all three lines got capitalized:
|
the second commit, we now see that all three lines got capitalized:
|
||||||
```shell script
|
```shell
|
||||||
$ jj diff -r @-
|
$ jj diff -r @-
|
||||||
Modified regular file file:
|
Modified regular file file:
|
||||||
1 1: aA
|
1 1: aA
|
||||||
|
@ -390,7 +390,7 @@ conflicts.
|
||||||
Let's try one final command for changing the contents of an exiting commit. That
|
Let's try one final command for changing the contents of an exiting commit. That
|
||||||
command is `jj diffedit`, which lets you edit the contents of a commit without
|
command is `jj diffedit`, which lets you edit the contents of a commit without
|
||||||
checking it out.
|
checking it out.
|
||||||
```shell script
|
```shell
|
||||||
$ jj diffedit -r @-
|
$ jj diffedit -r @-
|
||||||
Using default editor 'meld'; you can change this by setting ui.diff-editor
|
Using default editor 'meld'; you can change this by setting ui.diff-editor
|
||||||
Created 70985eaa924f ABC
|
Created 70985eaa924f ABC
|
||||||
|
|
Loading…
Reference in a new issue