From e3952df2c172c6f3eb533d8d0b1a6c77250769a7 Mon Sep 17 00:00:00 2001 From: Leila Muhtasib Date: Sat, 16 Jun 2012 12:02:21 -0400 Subject: [PATCH] Added git-info command. Updated Authors document to include the name of the person whose idea this was. --- AUTHORS | 2 ++ bin/git-info | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 bin/git-info diff --git a/AUTHORS b/AUTHORS index 07efc19..edc6128 100644 --- a/AUTHORS +++ b/AUTHORS @@ -20,3 +20,5 @@ Patches and Suggestions - Gert Van Gool - Devin Withers - David Baumgold +- Leila Muhtasib +- Duane Johnson \ No newline at end of file diff --git a/bin/git-info b/bin/git-info new file mode 100755 index 0000000..fc7aedd --- /dev/null +++ b/bin/git-info @@ -0,0 +1,40 @@ +#!/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 "## Remote URLs:\n" +echo "$(remote_urls)\n" + +echo "## Remote Branches:\n" +echo "$(remote_branches)\n" + +echo "## Local Branches:\n" +echo "$(local_branches)\n" + +echo "## Most Recent Commit:\n" +echo "$(most_recent_commit)\n" +echo "Type 'git log' for more commits, or 'git show ' for full commit details.\n" + +echo "## Configuration (.git/config):\n" +echo "$(get_config)\n" \ No newline at end of file