git completions: Only show last 1000 commits

This can be prohibitively slow on large repositories (minutes!).

While regrettable, no user is going to like waiting that long.

Work towards #3342, rerun of #3230.

Many thanks to @gladhorn for the idea!
This commit is contained in:
Fabian Homborg 2016-08-30 23:21:18 +02:00
parent 35bee00802
commit eeb42f5e54

View File

@ -6,7 +6,7 @@ function __fish_git_commits
# This allows filtering by subject with the new pager!
# Because even subject lines can be quite long,
# trim them (abbrev'd hash+tab+subject) to 73 characters
command git log --pretty=tformat:"%h"\t"%s" --all ^/dev/null \
command git log --pretty=tformat:"%h"\t"%s" --all --max-count=1000 ^/dev/null \
| string replace -r '(.{73}).+' '$1…'
end