File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,17 @@ done < <(
34
34
' :(exclude,glob)**/third-party/**'
35
35
' :(exclude,glob)**/third_party/**'
36
36
)
37
- if [ $# -gt 0 ]; then
38
- paths=(" $@ " )
37
+ if [ $# -eq 2 ]; then
38
+ for filename in $( git diff --name-only --unified=0 " $1 ...$2 " ) ; do
39
+ git diff --unified=0 " $1 ...$2 " -- " $filename " " ${excludes[@]} " \
40
+ | grep -E ' ^\+' \
41
+ | grep -Ev ' ^\+\+\+' \
42
+ | perl -nle ' print for m#' " $pattern " ' #g' \
43
+ | sed ' s|^|' " $filename " ' :|'
44
+ done
39
45
else
40
- paths=(' *' )
41
- fi
42
- git --no-pager grep --no-color -I -P -o " $pattern " -- " ${paths[@]} " " ${excludes[@]} " \
46
+ git --no-pager grep --no-color -I -P -o " $pattern " -- . " ${excludes[@]} "
47
+ fi \
43
48
| grep -Ev ' https?://' \
44
49
| sed -E \
45
50
-e ' s#([^:]+):\[[^]]+\]\(([^)]+)\)#\1:\2#' \
You can’t perform that action at this time.
0 commit comments