Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .asset/changes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/comment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/demo.mp4
Binary file not shown.
Binary file modified .asset/files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/review.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/sent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/social.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .asset/split.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions .doc/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ To run the tests against a real Rex too:

```sh
REXDIFF_REX=$(which rex) go test ./test/
REXDIFF_REX=$(which rex) test/e2e.sh
```

`test/e2e.sh` also needs jq.

## Release

```sh
gh release create v0.3.0
gh release create vX.Y.Z
```

GitHub Actions builds the binaries and updates the Homebrew cask.
GitHub Actions runs the tests again, builds the binaries, and updates the Homebrew cask.

## Rules

Expand Down
14 changes: 11 additions & 3 deletions .doc/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ rexdiff has library tests and black-box tests.
- Each library is tested through its public API only, in `package x_test`.
- A test that needs git runs real git in a temporary repository. `internal/testgit`
hides your git config, so hooks and signing do not change the result.
- A test uses the real limits of a library. A hook in `export_test.go` lowers a limit only
if the real size makes the test slow.
- A test gives the library its own environment, with fake tools on its own `PATH`. No
test changes the environment of the process, so all of them run in parallel.

Expand All @@ -17,12 +19,18 @@ rexdiff has library tests and black-box tests.
- `tui` has no unit tests. The tests in `test/` build the binary and use it as you do.
- Each test types keys and clicks through a terminal emulator, and reads the screen.
- A test waits for the screen or for a file, never for a fixed time.
- One test waits for the log: `TestLastTurn` waits for the line `msg="turn start"` in
the debug log.
- Some tests wait for a line in the debug log, for example `msg="turn start"`.
- The scripts in `test/testdata/script` test the commands, for example `install`, with
testscript.
- Shell scripts stand in for rex, gh, the clipboard, and the editors. The fake rex
prints output recorded from a real Rex.
- `TestRealRex` runs rexdiff in a real Rex, to find a fake that no longer matches Rex.
- `test/e2e.sh` runs rexdiff in a real Rex, one step at a time. It walks through the user
guide, hostile file names, tiny and huge blocks, boxes open while the block resizes, and
a long review. Each step waits until the screen shows a whole frame. The script also
checks that rex still prints JSON in the shapes that the fake rex records. Run it with
`REXDIFF_REX=$(which rex) test/e2e.sh`.
- The black-box tests run one at a time, because each one is a real program in a
terminal.
- The perf tests in `test/perf_test.go` time the program on large repositories. They run
only if `REXDIFF_PERF` names a directory for the repositories. The libraries have Go
benchmarks: `go test -bench . ./diff ./vcs ./internal/tree`.
18 changes: 13 additions & 5 deletions .doc/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ The diff is on the left. The changed files are on the right.

rexdiff reloads when a file changes.

Some files show a note instead of the diff:

- A binary file shows `binary file`.
- A file over 2 MB or 50,000 lines shows `file too large to show`.
- If more than 20,000 files change, rexdiff shows only their number.
- A Markdown file over 512 KB shows as source.

## 4. Pick what to compare

- `u`: the uncommitted changes
Expand All @@ -46,15 +53,15 @@ Press `B` to pick the base branch, and `G` to pick the commits.

## 5. See both sides

Press `|` to see the old and the new code side by side. Press `z` to hide the file list
if the pane is narrow.
Press `|` to see the old and the new code side by side. This needs 135 columns for the
code. Press `z` to hide the file list if the pane is narrow.

![Side by side](../.asset/split.png)

## 6. Comment

Put the cursor on a line, press `c`, type the comment, and press Enter. For more lines,
press `v` and move down first.
press `v` and move down first. You can also click or drag the line numbers.

![Writing a comment](../.asset/comment.png)

Expand All @@ -78,7 +85,7 @@ Enter.

![The review in the agent](../.asset/sent.png)

Press `y` to copy the review instead.
Press `y` to copy the review instead. Use `y` for a review over 256 KB.

## 9. See all the files

Expand Down Expand Up @@ -132,5 +139,6 @@ Press `?` to see all the keys.

![All keys](../.asset/help.png)

Press `U` to update when the bottom line shows a new version. Press `q` to quit.
Press `U` to update when the bottom line shows a new version. Press `q` to quit. If
there are unsent comments, rexdiff asks first. Press `Q` to quit and drop them.
`rexdiff uninstall` removes rexdiff from Rex.
Loading
Loading