The ads-github-merge-all-upstreams program should unset the 'GREP_OPTIONS'
environment variable prior to any grep invocation in order to avoid the
following warning message emitted by versions of GNU grep newer than version
2.11 when the variable is set:
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
Pros
-
When GNU grep 2.11 or newer is being used, then the above warning
message will not be emitted on stderr if the user has the
'GREP_OPTIONS' variable set. This is a "pro" because it avoids giving
the impression to the user that the ads-github-merge-all-upstreams
program is faulty in its use of grep. This behavior could also be seen
as a "con"; see below.
-
When GNU grep older than version 2.11 is being used, the behavior of
grep becomes more predictable as this change avoids implicitly adding
a bunch of arbitrary options to the grep invocation that we have no
control over.
Cons
- When GNU
grep 2.11 or newer is being used, then the above warning
message will not be emitted on stderr if the user has the
'GREP_OPTIONS' variable set. This could be seen as a "con" because it
"papers over" the issue. The user may not be aware that setting
GREP_OPTIONS could be problematic, and this behavior contributes to
keeping that information suppressed.
Background
Prior to GNU grep 2.11 (~2014-11), the 'GREP_OPTIONS' environment variable
could be used (without warning) to add options to each grep invocation. The
author of this bug report used it for years without problems, but only because
his use of it was simple and the options used innocuous. The feature itself,
however, is dangerous so was deprecated.
See also:
The
ads-github-merge-all-upstreamsprogram should unset the'GREP_OPTIONS'environment variable prior to any
grepinvocation in order to avoid thefollowing warning message emitted by versions of GNU
grepnewer than version2.11when the variable is set:Pros
When GNU
grep2.11 or newer is being used, then the above warningmessage will not be emitted on
stderrif the user has the'GREP_OPTIONS'variable set. This is a "pro" because it avoids givingthe impression to the user that the
ads-github-merge-all-upstreamsprogram is faulty in its use of
grep. This behavior could also be seenas a "con"; see below.
When GNU
grepolder than version 2.11 is being used, the behavior ofgrepbecomes more predictable as this change avoids implicitly addinga bunch of arbitrary options to the
grepinvocation that we have nocontrol over.
Cons
grep2.11 or newer is being used, then the above warningmessage will not be emitted on
stderrif the user has the'GREP_OPTIONS'variable set. This could be seen as a "con" because it"papers over" the issue. The user may not be aware that setting
GREP_OPTIONScould be problematic, and this behavior contributes tokeeping that information suppressed.
Background
Prior to GNU
grep 2.11(~2014-11), the'GREP_OPTIONS'environment variablecould be used (without warning) to add options to each
grepinvocation. Theauthor of this bug report used it for years without problems, but only because
his use of it was simple and the options used innocuous. The feature itself,
however, is dangerous so was deprecated.
See also: