projects
/
clearscm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of andrew@defaria.com:/opt/git/clearscm.git
[clearscm.git]
/
rc
/
functions
diff --git
a/rc/functions
b/rc/functions
index
fd373a2
..
89bfb9f
100644
(file)
--- a/
rc/functions
+++ b/
rc/functions
@@
-17,6
+17,21
@@
CR=$(echo "\015")
view_name=
view_name=
+function in_git_repo {
+ pwd=$PWD
+
+ while [ "$pwd" != "/" ]; do
+ if [ -d "$pwd/.git" ]; then
+ true;
+ return;
+ fi
+
+ pwd=$(dirname $pwd)
+ done
+
+ false
+} # in_git_repo
+
# Function to set the title bar. Works on the terminal emulators listed.
function title_bar {
prefix="$@"
# Function to set the title bar. Works on the terminal emulators listed.
function title_bar {
prefix="$@"
@@
-38,6
+53,11
@@
function title_bar {
current_dir="$current_dir ($(cat CVS/Root | tr -d $CR))"
fi
current_dir="$current_dir ($(cat CVS/Root | tr -d $CR))"
fi
+ # Add GIT info if available
+ if in_git_repo; then
+ current_dir="$current_dir [git: $(git branch | sed -n -e 's/^\* \(.*\)/\1/p')]"
+ fi
+
if [ "$TERM" = "hpterm" -o \
"$TERM" = "hp" -o \
"$TERM" = "2392A" ]; then
if [ "$TERM" = "hpterm" -o \
"$TERM" = "hp" -o \
"$TERM" = "2392A" ]; then
@@
-184,7
+204,7
@@
function ssh {
} # ssh
function sj {
} # ssh
function sj {
- if [ $ARCH = "FreeBSD" ]; then
+ if [ $ARCH
ITECTURE
= "FreeBSD" ]; then
psopts="-aux"
else
psopts="-ef"
psopts="-aux"
else
psopts="-ef"