File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
zsh code review plugin
4
4
5
+ ### Usage
6
+
7
+ ```
8
+ code-review [base_branch] [target_branch]
9
+ ```
10
+
11
+ - ` base_branch ` : (default: $REVIEW_BASE_BRANCH, master)
12
+ - ` target_branch ` : (default: HEAD)
13
+
14
+ Launches ` git difftool ` on ` git merge-base target_branch base_branch ` and
15
+ ` target_branch ` .
16
+
5
17
### Install
6
18
7
- If using ` antibody ` : ` antibody bundle xorkevin/code-review-zsh `
19
+ #### Antibody
20
+
21
+ ```
22
+ $ antibody bundle xorkevin/code-review-zsh
23
+ ```
24
+
25
+ #### Manual
26
+
27
+ In ` .zshrc ` :
28
+
29
+ ```
30
+ source code-review.plugin.zsh
31
+ ```
Original file line number Diff line number Diff line change @@ -5,14 +5,14 @@ function code-review () {
5
5
return
6
6
fi
7
7
8
- local base_branch=${1:- ${GIT_BASE_BRANCH :- master} }
8
+ local base_branch=${1:- ${REVIEW_BASE_BRANCH :- master} }
9
9
local target_branch=${2:- HEAD}
10
10
11
11
local merge_base=$( git merge-base $target_branch $base_branch )
12
12
13
13
local shortstatout=$( git diff --shortstat --color $merge_base $target_branch )
14
14
local statout=$( git diff --stat --color $merge_base $target_branch )
15
- local filesout=$( git diff --name-only $merge_base $target_branch )
15
+ local filesout=$( git diff --relative -- name-only $merge_base $target_branch )
16
16
17
17
local LESS
18
18
local selectfile
@@ -26,6 +26,7 @@ function code-review () {
26
26
# clear screen; move to top left
27
27
echo -ne " \e[2J\e[H"
28
28
echo " comparing $base_branch ..$target_branch "
29
+ echo " from $( pwd) "
29
30
echo $shortstatout
30
31
echo -n " Usage: l - list changed files, f - launch difftool for file, q - quit"
31
32
read -sk opt
You can’t perform that action at this time.
0 commit comments