From: Andrew DeFaria Date: Fri, 8 Nov 2013 02:07:42 +0000 (-0800) Subject: Moved git stuff to rc/git X-Git-Url: https://defaria.com/gitweb/?a=commitdiff_plain;h=14bd6c2ec7fb50112f0c3df8aa66ba568be97bd2;hp=8a384ea1c4e9c00a0e02a6fdf995529421f5ba82;p=clearscm.git Moved git stuff to rc/git --- diff --git a/rc/bash_login b/rc/bash_login index 1650c31..0008953 100644 --- a/rc/bash_login +++ b/rc/bash_login @@ -1,7 +1,7 @@ ################################################################################ # # File: $RCSfile: bash_login,v $ -# Revision: $Revision: 1.29 $ +# Revision: $Revision: 1.29 $ # Description: bash startup file # Author: Andrew@DeFaria.com # Created: Mon Aug 20 17:35:01 2001 @@ -116,6 +116,11 @@ if [ -f ~/.rc/multisite ]; then source ~/.rc/multisite fi +# Git Stuff +if [ -f ~/.rc/git ]; then + source ~/.rc/git +fi + # Import shell functions: if [ -f ~/.rc/functions ]; then source ~/.rc/functions diff --git a/rc/client_scripts/Axcient b/rc/client_scripts/Axcient deleted file mode 100755 index 9d80ec2..0000000 --- a/rc/client_scripts/Axcient +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -################################################################################ -# -# File: $RCSfile: Axcient,v $ -# Revision: $Revision: $ -# Description: Client specific start up for Axcient -# Author: Andrew@DeFaria.com -# Created: Tue Aug 13 11:49:46 PDT 2013 -# Modified: $Date: $ -# Language: bash -# -# (c) Copyright 2013, Andrew@DeFaria.com, all rights reserved. -# -################################################################################ -function git () { - # Need to reset title since we put the branch name in the titlebar - git=$(which git) - - if [ "$1" = "checkout" ]; then - $git $@ - set_title - else - $git $@ - fi -} # git diff --git a/rc/functions b/rc/functions index 47db2ca..69f8aa1 100644 --- a/rc/functions +++ b/rc/functions @@ -17,21 +17,6 @@ CR=$(echo "\015") 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="$@" diff --git a/rc/git b/rc/git new file mode 100644 index 0000000..fabea71 --- /dev/null +++ b/rc/git @@ -0,0 +1,41 @@ +#!/bin/bash +################################################################################ +# +# File: $RCSfile: git,v $ +# Revision: $Revision: 1.0 $ +# Description: This script set up some useful environment variables and aliases +# for git execution. File should be sourced (e.g . git) +# Author: Andrew@DeFaria.com +# Created: Thu Nov 7 18:00:34 PST 2013 +# Modified: $Date: $ +# Language: bash +# +# (c) Copyright 2000-2013, ClearSCM, Inc., all rights reserved. +# +################################################################################ +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 git () { + # Need to reset title since we put the branch name in the titlebar + git=$(which git) + + if [ "$1" = "checkout" -o "$1" = "co" ]; then + $git $@ + set_title + else + $git $@ + fi +} # git