X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=.zsh%2Frc%2Fextra%2F01_vcs_functions;fp=.zsh%2Frc%2Fextra%2F01_vcs_functions;h=e1ef10abe1dc4afa88ab88fc68600d390bcc6214;hb=3d71eab53c5b63556363ece880859b0af7f162da;hp=0000000000000000000000000000000000000000;hpb=1f8b08895681d46802368eec0764ca70d08898ca;p=config-20-100.git diff --git a/.zsh/rc/extra/01_vcs_functions b/.zsh/rc/extra/01_vcs_functions new file mode 100644 index 0000000..e1ef10a --- /dev/null +++ b/.zsh/rc/extra/01_vcs_functions @@ -0,0 +1,80 @@ +#!/bin/zsh +# Fichier contenant des fonctions "pratiques" de manipulation de +# VCS comme git ou cvs ou autre + +#f5# Cvs add +cvsa() { + emulate -L zsh + cvs add $* && cvs com -m 'initial checkin' $* +} +#f5# Cvs diff +cvsd() { + emulate -L zsh + cvs diff -N $* |& $PAGER +} +#f5# Cvs log +cvsl() { + emulate -L zsh + cvs log $* |& $PAGER +} +#f5# Cvs update +cvsq() { + emulate -L zsh + cvs -nq update +} +#f5# Rcs2log +cvsr() { + emulate -L zsh + rcs2log $* | $PAGER +} +#f5# Cvs status +cvss() { + emulate -L zsh + cvs status -v $* +} + +#f5# Find all files in \$PATH with setuid bit set +suidfind() { ls -latg $path | grep '^...s' } + +#f5# Get specific git commitdiff +git-get-diff() { + emulate -L zsh + if [[ -z $GITTREE ]] ; then + GITTREE='linux/kernel/git/torvalds/linux-2.6.git' + fi + if ! [[ -z $1 ]] ; then + ${=BROWSER} "http://kernel.org/git/?p=$GITTREE;a=commitdiff;h=$1" + else + echo "Usage: git-get-diff " + fi +} + +#f5# Get specific git commit +git-get-commit() { + emulate -L zsh + if [[ -z $GITTREE ]] ; then + GITTREE='linux/kernel/git/torvalds/linux-2.6.git' + fi + if ! [[ -z $1 ]] ; then + ${=BROWSER} "http://kernel.org/git/?p=$GITTREE;a=commit;h=$1" + else + echo "Usage: git-get-commit " + fi +} + +#f5# Get specific git diff +git-get-plaindiff () { + emulate -L zsh + if [[ -z $GITTREE ]] ; then + GITTREE='linux/kernel/git/torvalds/linux-2.6.git' + fi + if [[ -z $1 ]] ; then + echo 'Usage: git-get-plaindiff ' + else + echo -n "Downloading $1.diff ... " + # avoid "generating ..." stuff from kernel.org server: + wget --quiet "http://kernel.org/git/?p=$GITTREE;a=commitdiff_plain;h=$1" -O /dev/null + wget --quiet "http://kernel.org/git/?p=$GITTREE;a=commitdiff_plain;h=$1" -O $1.diff \ + && echo done || echo failed + fi +}