#!/bin/sh

get_config() {
  git config --list
}

most_recent_commit() {
  git log --max-count=1 --pretty=short
}

local_branches() {
  git branch
}

remote_branches() {
  git branch -r
}

remote_urls() {
  git remote -v
}

# Show info similar to svn

echo
echo -e "## Remote URLs:\n"
echo -e "$(remote_urls)\n"

echo -e "## Remote Branches:\n"
echo -e "$(remote_branches)\n"

echo -e "## Local Branches:\n"
echo -e "$(local_branches)\n"

echo -e "## Most Recent Commit:\n"
echo -e "$(most_recent_commit)\n"
echo -e "Type 'git log' for more commits, or 'git show <commit id>' for full commit details.\n"

if test "$1" != "--no-config"; then
  echo -e "## Configuration (.git/config):\n"
  echo -e "$(get_config)\n"
fi
