-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_profile
83 lines (62 loc) · 2.39 KB
/
.bash_profile
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
source /Users/joseph.dougherty/git-prompt.sh
PS1='[joe! \w$(__git_ps1 " (%s)")]\$ '
alias ll='ls -al'
alias less='less -SR' # -S turns on horizontal scroll. -R enables color support.
#=====================================================================#
# Start Workflow Functions and Aliases #
#=====================================================================#
export DOCSROOT=/Users/joseph.dougherty/mongosource/docs/source
function cr {
if [[ $1 == "" ]]; then
read -rp "Are you sure you want to create a new CR item? Y/n " yn
if [[ $yn == "y" || $yn == "Y" ]]; then
/Users/joseph.dougherty/codereview/cr
fi
return
else
/Users/joseph.dougherty/codereview/cr "$@"
fi
}
function occurrences {
while (( "$#" )); do
term="$1"
count=$(grep -ir "$term" $DOCSROOT | wc -l)
echo "$term": "$count"
shift
done
}
function reset-file-to-master {
git checkout origin/master "$@"
}
function delete-remote-branch {
git push origin --delete "$@"
}
function affected-files {
term="$1"
files=$(grep -irl "$term" $DOCSROOT)
count=$(occurrences "$term")
echo "$files"
echo "$count"
}
alias branch='git branch --show-current'
# Backporting aliases
alias bp5.0='git checkout -b $( branch )-v5.0-backport upstream/v5.0'
alias bp4.4='git checkout -b $( branch )-v4.4-backport upstream/v4.4'
alias bp4.2='git checkout -b $( branch )-v4.2-backport upstream/v4.2'
alias bp4.0='git checkout -b $( branch )-v4.0-backport upstream/v4.0'
# Workflow aliases
alias add-commit='git add . && git commit --amend --no-edit '
alias stage='git push origin -f $( branch ) ; '
# vale configuration
VALEBIN=/Users/joseph.dougherty/repos/mongodb-vale/bin
VALEINI=/Users/joseph.dougherty/repos/mongodb-vale/.vale.ini
alias vale='vale --config $VALEINI'
#=====================================================================#
# End Workflow Functions and Aliases #
#=====================================================================#
#=====================================================================#
# PATH #
#=====================================================================#
HOMEBIN=/Users/joseph.dougherty/bin
export PATH=$HOMEBIN:$VALEBIN:$PATH
export HISTTIMEFORMAT="%d/%m/%y %T "