svn commit: r332856 - head/usr.bin/grep
Kyle Evans
kevans at freebsd.org
Sat Apr 21 13:48:43 UTC 2018
On Sat, Apr 21, 2018 at 8:46 AM, Kyle Evans <kevans at freebsd.org> wrote:
> Author: kevans
> Date: Sat Apr 21 13:46:07 2018
> New Revision: 332856
> URL: https://svnweb.freebsd.org/changeset/base/332856
>
> Log:
> bsdgrep: Fix --include/--exclude ordering issues
>
> Prior to r332851:
> * --exclude always win out over --include
> * --exclude-dir always wins out over --include-dir
>
> r332851 broke that behavior, resulting in:
> * First of --exclude, --include wins
> * First of --exclude-dir, --include-dir wins
>
> As it turns out, both behaviors are wrong by modern grep standards- the
> latest rule wins. e.g.:
>
> `grep --exclude foo --include foo 'thing' foo`
> foo is included
>
> `grep --include foo --exclude foo 'thing' foo`
> foo is excluded
>
> As tested with GNU grep 3.1.
>
> This commit makes bsdgrep follow this behavior.
>
> Reported by: se
>
Just to be clear, because I don't want to mislead- se's report was
specifically that I broke the previous behavior. Later investigation
found that both behaviors were wrong.
More information about the svn-src-all
mailing list