]> gitweb.pimeys.fr Git - config-20-100.git/blob - .zsh/rc/extra/01_vcs_functions
Ajout du zshrc, même s'il manque encore de commentaires etc.
[config-20-100.git] / .zsh / rc / extra / 01_vcs_functions
1 #!/bin/zsh
2 # Fichier contenant des fonctions "pratiques" de manipulation de
3 # VCS comme git ou cvs ou autre
4
5 #f5# Cvs add
6 cvsa() {
7 emulate -L zsh
8 cvs add $* && cvs com -m 'initial checkin' $*
9 }
10 #f5# Cvs diff
11 cvsd() {
12 emulate -L zsh
13 cvs diff -N $* |& $PAGER
14 }
15 #f5# Cvs log
16 cvsl() {
17 emulate -L zsh
18 cvs log $* |& $PAGER
19 }
20 #f5# Cvs update
21 cvsq() {
22 emulate -L zsh
23 cvs -nq update
24 }
25 #f5# Rcs2log
26 cvsr() {
27 emulate -L zsh
28 rcs2log $* | $PAGER
29 }
30 #f5# Cvs status
31 cvss() {
32 emulate -L zsh
33 cvs status -v $*
34 }
35
36 #f5# Find all files in \$PATH with setuid bit set
37 suidfind() { ls -latg $path | grep '^...s' }
38
39 #f5# Get specific git commitdiff
40 git-get-diff() {
41 emulate -L zsh
42 if [[ -z $GITTREE ]] ; then
43 GITTREE='linux/kernel/git/torvalds/linux-2.6.git'
44 fi
45 if ! [[ -z $1 ]] ; then
46 ${=BROWSER} "http://kernel.org/git/?p=$GITTREE;a=commitdiff;h=$1"
47 else
48 echo "Usage: git-get-diff <commit>"
49 fi
50 }
51
52 #f5# Get specific git commit
53 git-get-commit() {
54 emulate -L zsh
55 if [[ -z $GITTREE ]] ; then
56 GITTREE='linux/kernel/git/torvalds/linux-2.6.git'
57 fi
58 if ! [[ -z $1 ]] ; then
59 ${=BROWSER} "http://kernel.org/git/?p=$GITTREE;a=commit;h=$1"
60 else
61 echo "Usage: git-get-commit <commit>"
62 fi
63 }
64
65 #f5# Get specific git diff
66 git-get-plaindiff () {
67 emulate -L zsh
68 if [[ -z $GITTREE ]] ; then
69 GITTREE='linux/kernel/git/torvalds/linux-2.6.git'
70 fi
71 if [[ -z $1 ]] ; then
72 echo 'Usage: git-get-plaindiff '
73 else
74 echo -n "Downloading $1.diff ... "
75 # avoid "generating ..." stuff from kernel.org server:
76 wget --quiet "http://kernel.org/git/?p=$GITTREE;a=commitdiff_plain;h=$1" -O /dev/null
77 wget --quiet "http://kernel.org/git/?p=$GITTREE;a=commitdiff_plain;h=$1" -O $1.diff \
78 && echo done || echo failed
79 fi
80 }