-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.zshgit
42 lines (36 loc) · 1.19 KB
/
.zshgit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
alias gnp='git --no-pager'
alias files-changed='gnp diff --name-only'
alias fix-rebase='subl $(files-changed)'
alias git-last-commit-mine='git commit --amend --author="Tom Kelley <distortedsignal@gmail.com>"'
alias grbkd='git rebase --committer-date-is-author-date'
function pyf-branch () {
pyflakes $(files-changed $1 | grep ".py")
}
function translate-src-to-beam() {
echo $1 | sed 's/\/src\//\/ebin\//' | sed 's/\.erl/\.beam/' | sed 's/\/k8s//' | sed 's/mgmt\/controller\/server\/apps\//build\/debug\/6\/mgmt\/default\/lib\//'
}
function move-changed () {
if [ $# -eq "1" ]
then
for CHANGEPATH in $(files-changed | grep "erl"); do
BEAMPATH=$(translate-src-to-beam $CHANGEPATH)
echo "Beam path: $BEAMPATH"
scpexp $1 $everest/$BEAMPATH
done
fi
if [ $# -eq "2" ]
then
for CHANGEPATH in $(files-changed $2 | grep "erl"); do
BEAMPATH=$(translate-src-to-beam $CHANGEPATH)
scpexp $1 $everest/$BEAMPATH
done
fi
}
function git-recents () {
if [ $# -eq "1" ]
then
git branch -v --sort=-committerdate | head -n $1
else
git branch -v --sort=-committerdate
fi
}