From 9585321ecf1270b8a828b8de93ac6d966cffa838 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Mon, 22 Feb 2010 10:23:16 +0100 Subject: [PATCH] tcsh aliases for remote gits and stuff --- config/versioncontrol.tcsh | 76 ++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/config/versioncontrol.tcsh b/config/versioncontrol.tcsh index 4304350..a104b00 100644 --- a/config/versioncontrol.tcsh +++ b/config/versioncontrol.tcsh @@ -1,45 +1,65 @@ +# collection of aliases for version control systems: cvs, svn, git, hg + alias difvu 'vim -R "+set syntax=diff"' +# update the repository alias cup cvs -q update -dP alias sup svn update -alias gup '(git fetch origin && git diff master..origin/master && git merge origin) |& difvu -' +#lias gup git pull +alias gup '(git fetch origin && git diff master..origin/master && git merge -s resolve origin) |& difvu -' +# check in check out alias ci cvs ci alias ci+ cvs ci -m + alias co cvs co +alias gi 'git commit -a;git push' +alias gi+ 'git commit -a -m +;git push' +alias go 'git checkout' # go +# branching +alias gcb 'git checkout -b' # create +alias gb 'git branch -a' # list all branches -# recursive cvsrm is a shell script -#alias crm 'rm -rf \!*;cvs rm \!*' +# cvs make and add +#alias cmd 'mkdir \!*;cvs add \!*;pushd \!*' +#alias cmf '$EDITOR \!*;cvs add \!*' +#alias cvsaddr 'cvs add `find . -depth -name "*CVS*" -prune -o -print`' +# if that failed, here's more +##alias cvsfr 'cvs add `find . -name "*CVS*" -prune -o -type f -print`' +# how to add a binary file, cause i never remember! +#alias cvsaddbin 'cvs add -kb' +# crm replaced by cvsrm* scripts -alias cmd 'mkdir \!*;cvs add \!*;cd \!*' -alias cmf '$EDITOR \!*;cvs add \!*' -alias cvsaddr 'cvs add `find . -name "*CVS*" -prune -o -print`' -# how to add a binary file.. cause i never remember!! -alias cvsaddbin 'cvs add -kb' - -alias cblame 'cvs annotate \!*|& $PAGER' - -alias cdiff 'cvs diff -bpu8r' -alias gdiff 'git-diff -b' -alias cdifr 'cdiff \!* |& egrep -v " (Diffing |no longer exists)"|& difvu -' -alias sdifr 'svn diff -r \!* |& difvu -' -alias gdifr 'gdiff \!* |& difvu -' -alias cdif 'cdifr HEAD' -alias sdif 'sdifr HEAD' -alias gdif 'gdifr HEAD' - -alias Ci '(cd $PSYCEDHOME;ci)' -alias Cup '(cd $PSYCEDHOME;cup)' -alias Cdif '(cd $PSYCEDHOME;cdif)' - -alias ctoc '(cd $CVSHOME;cvs diff -bur HEAD CHANGESTODO|& difvu -' -alias ctodo '(cd $PSYCEDHOME;cvs update CHANGESTODO;$EDITOR CHANGESTODO;cvs ci -m + CHANGESTODO)' -alias todo '(cd $PSYCEDHOME;$EDITOR CHANGESTODO)' +# diff: see what's going on +alias cdiff 'cvs diff -bpu8r' +alias gdiff 'git diff -b' +alias hdiff 'hg diff -b' +# difr +alias cdifr 'cdiff \!* |& egrep -v " (Diffing |no longer exists)"|& difvu -' +alias sdifr 'svn diff -r \!* |& difvu -' +alias gdifr 'gdiff \!* |& difvu -' +alias hdif 'hdiff \!* |& difvu -' +# used the most +alias cdif 'cdifr HEAD' +alias sdif 'sdifr HEAD' +alias gdif 'gdifr HEAD' # edit all files that contain a certain keyword # uses the +/searchstring syntax supported by vi and other smart editors -alias gred '$EDITOR "+/\!*" `grep -swIrl \!* .`' +alias gred '$EDITOR "+/\!*" `grep -swIrl \!* .`' # grep -r is a bit stupid: it follows symlinks, then shows us files twice # so using the git full text index may be smarter and faster alias ggred '$EDITOR "+/\!*" `git grep -w -l \!*`' +# otherwise use rgrep -e from http://perl.pages.de + +# cvs specific +alias ctodo '(cd $CVSHOME;$EDITOR CHANGESTODO)' +alias cblame 'cvs annotate \!*|& $PAGER' +alias cvsdeath 'find . -name CVS -print -prune -exec rm -r {} \;' + +# how to deal with remote gits: +# first, set up "git remote add " +# then "git fetch " and view with "gdifR " +alias gdifR 'git diff master..\!:1/master |& difvu -' +# to merge all the changes, use "gmergR " +alias gmergR 'git git merge -s resolve \!:1/master'