git staged<p>alias for<p><pre><code> git log remotes/trunk~4..HEAD --pretty=format:"%C(yellow)%h%C(white) %ad %aN%x09%d%x09%s" --date=short | awk -F'\t' '{gsub(/[, ]/,"",$2);gsub(/HEAD/, "\033[1;36mH\033[00m",$2);gsub(/master/, "\033[1;32mm\033[00m",$2);gsub(/trunk/, "\033[1;31mt\033[00m",$2);print $1 "\t" gensub(/([\(\)])/, "\033[0;33m\\1\033[00m","g",$2) $3}' | less -eiFRXS
</code></pre>
Shows condensed log of unpushed changes with colours and truncates HEAD/master/remote to initial letter.<p>Add to config with:<p><pre><code> git config alias.staged '!git log remotes/trunk~4..HEAD --date=short --pretty=format:"%C(yellow)%h%C(white) %ad %aN%x09%d%x09%s" | awk -F"\t" "{gsub(/[, ]/,\"\",\$2);gsub(/HEAD/, \"\033[1;36mH\033[00m\",\$2);gsub(/master/, \"\033[1;32mm\033[00m\",\$2);gsub(/trunk/, \"\033[1;31mt\033[00m\",\$2);print \$1 \"\t\" gensub(/([\(\)])/, \"\033[0;33m\\\\\1\033[00m\",\"g\",\$2) \$3}"'
</code></pre>
Although I've changed it a bit since I worked out the above. Here's what I currently have in my config file:<p><pre><code> staged = "!sh -c 'git log ${1-remotes/trunk~4..HEAD} --pretty=format:\"%C(yellow)%h%C(white) %ad %aN%x09%d%x09%s\" --date=short $2 | awk -F\"\\t\" \"{gsub(/[, ]/,\\\"\\\",\\$2);gsub(/HEAD/, \\\"\\033[1;36mH\\033[00m\\\",\\$2);gsub(/master/, \\\"\\033[1;32mm\\033[00m\\\",\\$2);gsub(/trunk/, \\\"\\033[1;31mt\\033[00m\\\",\\$2);gsub(/$USERNAME/,\\\"\\033[0;33m$USERNAME\\033[00m\\\",\\$1);print \\$1 \\\"\\t\\\" gensub(/([\\(\\)])/, \\\"\\033[0;33m\\\\\\\\\\1\\033[00m\\\",\\\"g\\\",\\$2) \\$3}\" | less -eiFRX' -"</code></pre>