Enable diffing against any commit.

Closes #309.
This commit is contained in:
Andy Stewart
2016-04-20 11:19:34 +01:00
parent 78d83c7056
commit 75eee3e407
4 changed files with 27 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ Features:
* Ensures signs are always as up to date as possible (but without running more than necessary).
* Quick jumping between blocks of changed lines ("hunks").
* Stage/revert/preview individual hunks.
* Diffs against index (default) or any commit.
* Handles line endings correctly, even with repos that do CRLF conversion.
* Optional line highlighting.
* Fully customisable (signs, sign column, line highlights, mappings, extra git-diff arguments, etc).
@@ -178,6 +179,7 @@ You can customise:
* Whether or not the sign column is shown when there aren't any signs (defaults to no)
* The signs' colours and symbols
* Line highlights
* The base of the diff
* Extra arguments for `git diff`
* Key mappings
* Whether or not vim-gitgutter is on initially (defaults to on)
@@ -244,6 +246,16 @@ GitGutterDeleteLine " default: links to DiffDelete
GitGutterChangeDeleteLine " default: links to GitGutterChangeLineDefault, i.e. DiffChange
```
#### The base of the diff
By default buffers are diffed against the index. However you can diff against any commit by setting:
```viml
let g:gitgutter_diff_base = '<commit SHA>'
```
#### Extra arguments for `git diff`
If you want to pass extra arguments to `git diff`, for example to ignore whitespace, do so like this: