show missing upstream branches
This commit is contained in:
parent
07e35d8b8c
commit
0f17558dfe
1 changed files with 8 additions and 1 deletions
9
gis
9
gis
|
|
@ -197,8 +197,12 @@ for dir in "${git_dirs[@]}"; do
|
|||
|
||||
# Get status
|
||||
remote_status_keys=""
|
||||
has_upstream=true
|
||||
while read -r status; do
|
||||
if [[ "$status" =~ ^\#\#.*\[(.*)\] ]]; then
|
||||
if [[ "$status" =~ ^\#\#\ (.*) ]] && [ "$(git remote | wc -l)" -gt 0 ]; then
|
||||
[[ "${BASH_REMATCH[1]}" != *"..."* ]] && has_upstream=false
|
||||
fi
|
||||
if [[ "$status" =~ ^\#\#.*\ \[(.*)\] ]]; then
|
||||
[[ "${BASH_REMATCH[1]}" == *"ahead"* ]] && [[ "${BASH_REMATCH[1]}" == *"behind"* ]] && remote_status_keys="⇕" && continue
|
||||
[[ "${BASH_REMATCH[1]}" == *"ahead"* ]] && remote_status_keys="⇡" && continue
|
||||
[[ "${BASH_REMATCH[1]}" == *"behind"* ]] && remote_status_keys="⇣" && continue
|
||||
|
|
@ -235,6 +239,9 @@ for dir in "${git_dirs[@]}"; do
|
|||
num_additional_branches=$(( num_additional_branches - 1 ))
|
||||
output="${output};${text_bold}${text_yellow}${current_branch}${text_reset} (${origin_head}${text_reset})"
|
||||
fi
|
||||
if [ "$has_upstream" == false ]; then
|
||||
output="${output} (no upstream)"
|
||||
fi
|
||||
if [[ $num_additional_branches -gt 0 ]]; then
|
||||
output="${output} (+${num_additional_branches})"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue