naming fixes, terminal title fixes
[feisty_meow.git] / scripts / rev_control / git_info.sh
1 #!/bin/bash
2  
3 # author: Duane Johnson
4 # email: duane.johnson@gmail.com
5 # date: 2008 Jun 12
6 # license: MIT
7 #
8 # Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496
9
10 # mods made to save and restore terminal title by fred for feisty meow codebase.
11
12 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
13
14 save_terminal_title
15  
16 pushd . >/dev/null
17  
18 # Find base of git directory
19 while [ ! -d .git ] && [ ! `pwd` = "/" ]; do cd ..; done
20  
21 # Show various information about this git directory
22 if [ -d .git ]; then
23 echo "== Remote URL: `git remote -v`"
24  
25 echo "== Remote Branches: "
26 git branch -r
27 echo
28  
29 echo "== Local Branches:"
30 git branch
31 echo
32  
33 echo "== Configuration (.git/config)"
34 cat .git/config
35 echo
36  
37 echo "== Most Recent Commit"
38 git --no-pager log --max-count=1
39 echo
40  
41 echo "type 'git log' for more commits, or 'git show' for full commit details."
42 else
43 echo "not a git repository."
44 fi
45  
46 popd >/dev/null
47
48 restore_terminal_title
49