mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
completions: [git] Use builtin git truncation
This commit is contained in:
parent
c6e7b7ef00
commit
6c0f31d622
1 changed files with 2 additions and 4 deletions
|
@ -6,16 +6,14 @@ function __fish_git_commits
|
||||||
# This allows filtering by subject with the new pager!
|
# This allows filtering by subject with the new pager!
|
||||||
# Because even subject lines can be quite long,
|
# Because even subject lines can be quite long,
|
||||||
# trim them (abbrev'd hash+tab+subject) to 73 characters
|
# trim them (abbrev'd hash+tab+subject) to 73 characters
|
||||||
command git log --pretty=tformat:"%h"\t"%s" --all --max-count=1000 2>/dev/null \
|
command git log --pretty=tformat:"%h"\t"%<(64,trunc)%s" --all --max-count=1000 2>/dev/null
|
||||||
| string replace -r '(.{73}).+' '$1…'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_git_recent_commits
|
function __fish_git_recent_commits
|
||||||
# Like __fish_git_commits, but not on all branches and limited to
|
# Like __fish_git_commits, but not on all branches and limited to
|
||||||
# the last 50 commits. Used for fixup, where only the current branch
|
# the last 50 commits. Used for fixup, where only the current branch
|
||||||
# and the latest commits make sense.
|
# and the latest commits make sense.
|
||||||
command git log --pretty=tformat:"%h"\t"%s" --max-count=50 2>/dev/null \
|
command git log --pretty=tformat:"%h"\t"%<(64,trunc)%s" --max-count=50 2>/dev/null
|
||||||
| string replace -r '(.{73}).+' '$1…'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_git_branches
|
function __fish_git_branches
|
||||||
|
|
Loading…
Reference in a new issue