mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +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!
|
||||
# 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 --max-count=1000 2>/dev/null \
|
||||
| string replace -r '(.{73}).+' '$1…'
|
||||
command git log --pretty=tformat:"%h"\t"%<(64,trunc)%s" --all --max-count=1000 2>/dev/null
|
||||
end
|
||||
|
||||
function __fish_git_recent_commits
|
||||
# Like __fish_git_commits, but not on all branches and limited to
|
||||
# the last 50 commits. Used for fixup, where only the current branch
|
||||
# and the latest commits make sense.
|
||||
command git log --pretty=tformat:"%h"\t"%s" --max-count=50 2>/dev/null \
|
||||
| string replace -r '(.{73}).+' '$1…'
|
||||
command git log --pretty=tformat:"%h"\t"%<(64,trunc)%s" --max-count=50 2>/dev/null
|
||||
end
|
||||
|
||||
function __fish_git_branches
|
||||
|
|
Loading…
Reference in a new issue