mirror of
https://github.com/aquatix/dotfiles.git
synced 2025-12-06 20:35:11 +01:00
Moved git version fallback to bashrc
This commit is contained in:
@@ -1,45 +1,5 @@
|
||||
PATH=$PATH:~/bin
|
||||
|
||||
# http://stackoverflow.com/questions/4023830/bash-how-compare-two-strings-in-version-format
|
||||
vercomp () {
|
||||
if [[ $1 == $2 ]]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
local IFS=.
|
||||
local i ver1=($1) ver2=($2)
|
||||
# fill empty fields in ver1 with zeros
|
||||
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
|
||||
do
|
||||
ver1[i]=0
|
||||
done
|
||||
for ((i=0; i<${#ver1[@]}; i++))
|
||||
do
|
||||
if [[ -z ${ver2[i]} ]]
|
||||
then
|
||||
# fill empty fields in ver2 with zeros
|
||||
ver2[i]=0
|
||||
fi
|
||||
if ((10#${ver1[i]} > 10#${ver2[i]}))
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
if ((10#${ver1[i]} < 10#${ver2[i]}))
|
||||
then
|
||||
return 2
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
# check version of git
|
||||
vercomp "1.7.11" `git --version|awk '{ print $3 }'`
|
||||
case $? in
|
||||
0) op='=';;
|
||||
1) git config --global push.default matching; git config --global pull.default matching ;; # op='>';;
|
||||
2) op='<';;
|
||||
esac
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
@@ -98,6 +58,7 @@ alias so=git
|
||||
# so rebase
|
||||
# so diff
|
||||
|
||||
# mercurial coloured diff
|
||||
alias hgd='hg diff | colordiff -y | less -R'
|
||||
|
||||
# 20140521 force 256 colours in tmux
|
||||
@@ -117,6 +78,7 @@ alias tmux_reload="tmux source-file ~/.tmux.conf"
|
||||
alias dcpvag='workon dcp; cd ~/workspace/sanoma/content-library/; vagrant ssh'
|
||||
alias dcpsrc='cd development/current/content-library/src/content_library/; . ~/development/env/bin/activate'
|
||||
|
||||
# if you're really annoyed with a runaway process
|
||||
function fuck() {
|
||||
if killall -9 "$2"; then
|
||||
echo ; echo " (╯°□°)╯︵$(echo "$2"|toilet -f term -F rotate)"; echo
|
||||
|
||||
Reference in New Issue
Block a user