Skip to content

Commit 938e891

Browse files
Beat Bolligitster
authored andcommitted
doc: avoid redundant use of cat
The update-hook-example.txt script uses this anti-pattern twice. Call grep with the input file name directy. While at it, merge the two consecutive grep calls. Signed-off-by: Beat Bolli <[email protected]> Acked-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2953d95 commit 938e891

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Documentation/howto/update-hook-example.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ info "The user is: '$username'"
100100

101101
if test -f "$allowed_users_file"
102102
then
103-
rc=$(cat $allowed_users_file | grep -v '^#' | grep -v '^$' |
103+
rc=$(grep -Ev '^(#|$)' $allowed_users_file |
104104
while read heads user_patterns
105105
do
106106
# does this rule apply to us?
@@ -138,7 +138,7 @@ info "'$groups'"
138138

139139
if test -f "$allowed_groups_file"
140140
then
141-
rc=$(cat $allowed_groups_file | grep -v '^#' | grep -v '^$' |
141+
rc=$(grep -Ev '^(#|$)' $allowed_groups_file |
142142
while read heads group_patterns
143143
do
144144
# does this rule apply to us?

0 commit comments

Comments
 (0)