The pending buffer for whole-file changes is currently only flushed when
encountering a new diff header. This leads to it being carried over
across commit boundaries in cases where multiple commits are shown. To
fix this, we simply need to flush the buffered data on a commit
boundary as well.
Fixes#1089
The test_process_calling_cmdline test only allows "cargo test" and
"cargo tarpaulin" for running the testsuite, for "cargo t" is a
built-in alias for "cargo test" and should be allowed, too.
Up until commit 55287a8 "Run in diff mode iff two positional arguments
are supplied" diff mode was only supported when stdin is connected to a
tty, which meant that, for example, running `delta a b` in a git hook
would do the wrong thing.
As a fix, the tty check was removed, so now `delta a b` always works,
but the only error condition is now to pass only a single file. When
passing no files at all, we try parse to stdin even when connected to a
tty. Usually that wouldn't be that bad, because the user could press
Ctrl-C or Ctrl-D (EOF) to quit, unfortunately something in the pager
setup breaks this, and the only way to exit `delta` is to kill it.
Running `delta` with stdin connected to a tty would mean that the user
has to manually enter a diff (or paste it), which is not really an
expected scenario, as demonstrated by the error message that's currently
only emitted when running `delta` with only a single file argument. So
we can avoid the lockup by also emitting the error message when running
on a tty and there are no files to be diffed.
Fixes#1039, fixes#1090
* Use "overridden" instead of "overriden"
* Use "line_numbers" instead of "linennumbers"
* Use "context" instead of "contexct"
* Use "summary" instead of "sumary"
* Add 'light = false' w/ comment in gitconfig
As mentioned in #1072, the macOS default terminal is light and it's challenging to find documentation on how to make delta copacetic with it, so this adds an explicit `light = false` in the `.gitconfig` example, with a comment explaining that it can be changed for light terminals.
* Update README.md
fix indentation
This allow to no longer ignore some tests (marked previously as FIXME)
by storing the env at the start of the program (Or creating a custom env
for test purpose)
This centralize almost alls calls to std::env inside one wrapper
Add a test profile to increase speed for testing (5min -> 20sec on my
machine)
clean a few code style like this:
```
if Some(value) = ...
if value
```
to
```
if Some(true) = ...
```
Co-authored-by: William Escande <wescande@google.com>
Fix#128
Add support for `git diff -D` (aka irreversible delete)
The patch is adding a title for removed file, even when there is no file content in the diff output
Without the patch, there was no output related to the file at all
The env var DELTA_CALLING_PROCESS_QUERY_ALL re-enables this
last resort method. However usually this is just an expensive
scan which doesn't find the caller anyhow.
When detecting input generated by `delta <(echo foo) <(echo bar)`
fall back to plain `diff` instead of `git diff --no-index`.
This does not respect various git settings anymore (the original reason
to switch from `diff` to `git diff`), but is better than just showing
the names of the temporary files.