Support diffs relative to the working tree.

Closes #558.
This commit is contained in:
Andy Stewart
2019-08-28 09:22:06 +01:00
parent 83eb5377be
commit 8bafd08ef4
5 changed files with 29 additions and 2 deletions

View File

@@ -260,6 +260,7 @@ You can customise:
* How to handle non-gitgutter signs
* The signs' colours and symbols
* Line highlights
* Whether the diff is relative to the index (default) or working tree.
* The base of the diff
* Extra arguments for `git` when running `git diff`
* Extra arguments for `git diff`
@@ -383,6 +384,15 @@ highlight link GitGutterChangeLineNr Underlined
```
#### Whether the diff is relative to the index or working tree
By default diffs are relative to the index. How you can make them relative to the working tree:
```viml
let g:gitgutter_diff_relative_to = 'working_tree'
```
#### The base of the diff
By default buffers are diffed against the index. However you can diff against any commit by setting:
@@ -391,6 +401,8 @@ By default buffers are diffed against the index. However you can diff against a
let g:gitgutter_diff_base = '<commit SHA>'
```
This setting is ignored when the diffs are relative to the working tree.
#### Extra arguments for `git` when running `git diff`