Checking if a git clone has any unique content, git/svn scripts

When cleaning up a system and going over git repositories I often wonder if a git repo contains any interesting, but unpushed work. (i.e. "unique" content)
I heard bzr (or was it hg...) can do it out-of-the-box, but I couldn't find any existing solution for git.
So I wrote a script to do this. It checks a repo for unique commits, tags, branches, dirty files/index, added files, or stashed states. In comparison to a specific remote, or all of them, and uses an appropriate exitcode.
The script is part of a bigger git-scripts repo (most of the scripts written by random people). Although the original repo creator hasn't gotten back to me this seems like a good starting point to have some sense of order in the wildspread of git scripts.

Here are some other scripts I find pretty useful:

  • git-ignore-wizard: dmenu-file-selector for adding ignore rules because I always forget which file to use for which use-case.
  • git-root: get the path of the git root
  • git-merge-repo: haven't tried this, but looks neat

On the topic of scripts for VCS'es, I also have one for svn.
This one is for those occasions where you have a directory tree in svn, and you want to replace the entire tree by another tree. The structure can be completely different (files, directories added/renamed,removed, etc) and it becomes painful to do it manually, if you even manage to keep svn from going berzerk on you.
svn-replace-subtree takes care of it.