Rename binary to `difft` for brevity

pull/70/head
Wilfred Hughes 2021-10-23 16:19:33 +07:00
parent 5c3f95ae29
commit c698f8979b
5 changed files with 22 additions and 19 deletions

@ -1,6 +1,9 @@
## 0.12 (unreleased)
No changes yet.
### Command Line Interface
The difftastic binary is now named `difft`, to reduce typing during
usage.
## 0.11

@ -38,7 +38,7 @@ project. Set `GIT_EXTERNAL_DIFF` to point to your current build.
For example, you can run difftastic on its own source code.
```
$ GIT_EXTERNAL_DIFF=./target/release/difftastic git log -p --ext-diff -- src
$ GIT_EXTERNAL_DIFF=./target/release/difft git log -p --ext-diff -- src
```
## Profiling
@ -48,21 +48,21 @@ If you have a file that's particularly slow, you can use
which functions are slow.
```
$ cargo flamegraph --bin difftastic sample_files/slow_before.rs sample_files/slow_after.rs
$ cargo flamegraph --bin difft sample_files/slow_before.rs sample_files/slow_after.rs
```
It's also worth looking at memory usage, as graph traversal bugs can
lead to huge memory consumption.
```
$ /usr/bin/time -v ./target/release/difftastic sample_files/slow_before.rs sample_files/slow_after.rs
$ /usr/bin/time -v ./target/release/difft sample_files/slow_before.rs sample_files/slow_after.rs
```
If timing measurement are noisy, Linux's `perf` tool will report
instructions executed, which is more stable.
```
$ perf stat ./target/release/difftastic sample_files/slow_before.rs sample_files/slow_after.rs
$ perf stat ./target/release/difft sample_files/slow_before.rs sample_files/slow_after.rs
```
Many more profiling techniques are discussed in the [The Rust

@ -16,7 +16,7 @@ builds.
## Diffing Files
```
$ difftastic sample_files/before.js sample_files/after.js
$ difft sample_files/before.js sample_files/after.js
```
Difftastic uses the file extension to decide which parser to use.
@ -28,22 +28,22 @@ tools](https://git-scm.com/docs/diff-config#Documentation/diff-config.txt-diffex
can use `GIT_EXTERNAL_DIFF` for a one-off git command.
```
$ GIT_EXTERNAL_DIFF=difftastic git diff
$ GIT_EXTERNAL_DIFF=difftastic git log -p --ext-diff
$ GIT_EXTERNAL_DIFF=difftastic git show e96a7241760319 --ext-diff
$ GIT_EXTERNAL_DIFF=difft git diff
$ GIT_EXTERNAL_DIFF=difft git log -p --ext-diff
$ GIT_EXTERNAL_DIFF=difft git show e96a7241760319 --ext-diff
```
If you want to use difftastic by default, use `git config`.
```
# Set git configuration for the current repository.
$ git config diff.external difftastic
$ git config diff.external difft
# Set git configuration for all repositories.
$ git config --global diff.external difftastic
$ git config --global diff.external difft
```
After running `git config`, `git diff` will use `difftastic`
After running `git config`, `git diff` will use `difft`
automatically. Other git commands require `--ext-diff` to use
`diff.external`.
@ -67,7 +67,7 @@ following to your `.gitconfig` to use difftastic as your difftool.
prompt = false
[difftool "difftastic"]
cmd = difftastic "$LOCAL" "$REMOTE"
cmd = difft "$LOCAL" "$REMOTE"
```
You can then run `git difftool` to see current changes with difftastic.
@ -88,13 +88,13 @@ your `.hgrc`.
extdiff =
```
You can then run `hg extdiff -p difftastic` (assumes difftastic is on
your `$PATH`).
You can then run `hg extdiff -p difft` (assumes the `difft` binary is
on your `$PATH`).
You can also define an alias to run difftastic with hg. Add the
following to your `.hgrc` to run difftastic with `hg dft`.
```
[extdiff]
cmd.dft = difftastic
cmd.dft = difft
```

@ -12,7 +12,7 @@ the parse tree that tree-sitter produces using the `--dump-ts`
flag.
```
$ difftastic --dump-ts sample_files/before.js
$ difft --dump-ts sample_files/before.js
{Node program (0, 0) - (7, 0)}
{Node comment (0, 0) - (0, 8)}
{Node expression_statement (1, 0) - (1, 6)}
@ -36,7 +36,7 @@ The flag `--dump-syntax` will display the syntax tree generated for a
file.
```
$ difftastic --dump-syntax sample_files/before.js
$ difft --dump-syntax sample_files/before.js
[
Atom id:1 {
content: "// hello",
@ -70,7 +70,7 @@ as nodes.
```
$ echo '[1]' > example.js
$ difftastic --dump-ts example.js
$ difft --dump-ts example.js
{Node program (0, 0) - (1, 0)}
{Node expression_statement (0, 0) - (0, 3)}
{Node array (0, 0) - (0, 3)}