nutools/lib/completion.d/ptools

18 lines
605 B
Plaintext
Raw Permalink Normal View History

# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
function __pdev_branches() {
2015-03-28 01:04:57 +04:00
local prefix=origin/
{
git for-each-ref refs/heads/ --format='%(refname:short)' 2>/dev/null
git for-each-ref "refs/remotes/$prefix" --format='%(refname:short)' 2>/dev/null | grep -F "$prefix" | cut -c $((${#prefix} + 1))-
2015-03-28 01:16:04 +04:00
} | LANG=C sort -u |
2015-03-28 01:04:57 +04:00
grep -vF HEAD |
grep -vF master |
grep -v '^release-' |
grep -v '^hotfix-'
}
function __prel_branches() {
git for-each-ref --format='%(refname:short)' refs/heads 2>/dev/null |
grep -E '^(master$|release-)'
}