#!/usr/bin/env sh
#
# g - show short status or alias git based on args

set -e

if [ "$#" -gt 0 ]; then
  exec git "$*"
else
  # clear && git status --short --branch && echo
  clear && git status --short --branch
  # echo "" && git lego -n 5
  # echo "" && git branch
  git status
fi

# if [ -z "$1" ]; then
#   git status -sb
# else
#   git $*
#   # if first argument is a file, then perform `git status` on it
#   # if command -p -- test -e "${1-}"; then
#   #   git status -- "${@-}"
#   # else
#   #   git -c color.status=always -c core.quotePath=false "${@:-status}" |
#   #     command -p -- sed \
#   #       -e '$ d'
#   # fi
# fi
