tpope / vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
https://www.vim.org/scripts/script.php?script_id=2975
20.02k stars 1.01k forks source link

GGrep fails with error message #1194

Closed spinlock99 closed 5 years ago

spinlock99 commented 5 years ago

After a recent update, Ggrep has stopped working for me. It is failing with the following error:

error: unknown option `column'
usage: git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]

    --cached              search in index instead of in the work tree
    --no-index            find in contents not managed by git
    --untracked           search in both tracked and untracked files
    --exclude-standard    ignore files specified via '.gitignore'
    --recurse-submodules  recursively search in each submodule

    -v, --invert-match    show non-matching lines
    -i, --ignore-case     case insensitive matching
    -w, --word-regexp     match patterns only at word boundaries
    -a, --text            process binary files as text
    -I                    don't match patterns in binary files
    --textconv            process binary files with textconv filters
    --max-depth <depth>   descend at most <depth> levels

    -E, --extended-regexp
                          use extended POSIX regular expressions
    -G, --basic-regexp    use basic POSIX regular expressions (default)
    -F, --fixed-strings   interpret patterns as fixed strings
    -P, --perl-regexp     use Perl-compatible regular expressions

    -n, --line-number     show line numbers
    -h                    don't show filenames
    -H                    show filenames
    --full-name           show filenames relative to top directory
    -l, --files-with-matches
                          show only filenames instead of matching lines
    --name-only           synonym for --files-with-matches
    -L, --files-without-match
                          show only the names of files without match
    -z, --null            print NUL after filenames
    -c, --count           show the number of matches instead of matching lines
    --color[=<when>]      highlight matches
    --break               print empty line between matches from different files
    --heading             show filename only once above matches from same file

    -C, --context <n>     show <n> context lines before and after matches
    -B, --before-context <n>
                          show <n> context lines before matches
    -A, --after-context <n>
                          show <n> context lines after matches
    --threads <n>         use <n> worker threads
    -NUM                  shortcut for -C NUM
    -p, --show-function   show a line with the function name before matches
    -W, --function-context
                          show the surrounding function

    -f <file>             read patterns from file
    -e <pattern>          match <pattern>
    --and                 combine patterns specified with -e
    --or
    --not
    (
    )
    -q, --quiet           indicate hit with exit status without output
    --all-match           show only matches from files that match all patterns

    -O, --open-files-in-pager[=<pager>]
                          show matching files in the pager
    --ext-grep            allow calling of grep(1) (ignored by this build)

Press ENTER or type command to continue
spinlock99 commented 5 years ago

The issue was that my git version was 2.17 which doesn't implement column

I upgraded to git v2.19 and Ggrep is working perfectly again.

The only place I could find column in the code does test the git version so I don't know where this behavior could be coming from:

https://github.com/tpope/vim-fugitive/blob/master/autoload/fugitive.vim#L2800

tpope commented 5 years ago

Definitely still a bug. Is there any way you could reproduce your old setup and check :echo fugitive#GitVersion(2, 19)? There's probably something wrong there, perhaps because it's using a different version of Git for testing versus execution.

tpope commented 5 years ago

Oh, check if g:fugitive_git_executable and g:fugitive_git_command are the same.

spinlock99 commented 5 years ago

OK, I removed homebrew's git and I'm just using the one from Apple's DevTools:

$ git --version
git version 2.17.2 (Apple Git-113)

:echo fugitive#GitVersion(2, 19) evaluates to 1

g:fugitive_git_executable is git but it looks like g:fugitive_git_command isn't defined.

spinlock99 commented 5 years ago

I just upgraded and commit 8899468 fixes this bug.

Thanks!