mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Add g:gitgutter_git_args for args to git when running git-diff.
See #541, #546.
This commit is contained in:
@@ -212,6 +212,7 @@ You can customise:
|
|||||||
* The signs' colours and symbols
|
* The signs' colours and symbols
|
||||||
* Line highlights
|
* Line highlights
|
||||||
* The base of the diff
|
* The base of the diff
|
||||||
|
* Extra arguments for `git` when running `git diff`
|
||||||
* Extra arguments for `git diff`
|
* Extra arguments for `git diff`
|
||||||
* Key mappings
|
* Key mappings
|
||||||
* Whether or not vim-gitgutter is on initially (defaults to on)
|
* Whether or not vim-gitgutter is on initially (defaults to on)
|
||||||
@@ -297,6 +298,14 @@ let g:gitgutter_diff_base = '<commit SHA>'
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### Extra arguments for `git` when running `git diff`
|
||||||
|
|
||||||
|
If you want to pass extra arguments to `git` when running `git diff`, do so like this:
|
||||||
|
|
||||||
|
```viml
|
||||||
|
let g:gitgutter_git_args = '--git-dir-""'
|
||||||
|
```
|
||||||
|
|
||||||
#### Extra arguments for `git diff`
|
#### Extra arguments for `git diff`
|
||||||
|
|
||||||
If you want to pass extra arguments to `git diff`, for example to ignore whitespace, do so like this:
|
If you want to pass extra arguments to `git diff`, for example to ignore whitespace, do so like this:
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ function! gitgutter#diff#run_diff(bufnr, preserve_full_diff) abort
|
|||||||
call s:write_buffer(a:bufnr, buff_file)
|
call s:write_buffer(a:bufnr, buff_file)
|
||||||
|
|
||||||
" Call git-diff with the temporary files.
|
" Call git-diff with the temporary files.
|
||||||
let cmd .= g:gitgutter_git_executable.' --no-pager'
|
let cmd .= g:gitgutter_git_executable.' --no-pager '.g:gitgutter_git_args
|
||||||
if s:c_flag
|
if s:c_flag
|
||||||
let cmd .= ' -c "diff.autorefreshindex=0"'
|
let cmd .= ' -c "diff.autorefreshindex=0"'
|
||||||
let cmd .= ' -c "diff.noprefix=false"'
|
let cmd .= ' -c "diff.noprefix=false"'
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ Most important option:~
|
|||||||
Git:~
|
Git:~
|
||||||
|
|
||||||
|g:gitgutter_git_executable|
|
|g:gitgutter_git_executable|
|
||||||
|
|g:gitgutter_git_args|
|
||||||
|g:gitgutter_diff_args|
|
|g:gitgutter_diff_args|
|
||||||
|g:gitgutter_diff_base|
|
|g:gitgutter_diff_base|
|
||||||
|
|
||||||
@@ -270,6 +271,15 @@ Default: 'git'
|
|||||||
This option determines what git binary to use. Set this if git is not on your
|
This option determines what git binary to use. Set this if git is not on your
|
||||||
path.
|
path.
|
||||||
|
|
||||||
|
*g:gitgutter_git_args*
|
||||||
|
Default: empty
|
||||||
|
|
||||||
|
Use this option to pass any extra arguments to git when running git-diff.
|
||||||
|
For example:
|
||||||
|
>
|
||||||
|
let g:gitgutter_git_args = '--git-dir=""'
|
||||||
|
<
|
||||||
|
|
||||||
*g:gitgutter_diff_args*
|
*g:gitgutter_diff_args*
|
||||||
Default: empty
|
Default: empty
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
call s:set('g:gitgutter_sign_modified_removed', '~_')
|
call s:set('g:gitgutter_sign_modified_removed', '~_')
|
||||||
|
call s:set('g:gitgutter_git_args', '')
|
||||||
call s:set('g:gitgutter_diff_args', '')
|
call s:set('g:gitgutter_diff_args', '')
|
||||||
call s:set('g:gitgutter_diff_base', '')
|
call s:set('g:gitgutter_diff_base', '')
|
||||||
call s:set('g:gitgutter_map_keys', 1)
|
call s:set('g:gitgutter_map_keys', 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user