From owner-svn-src-head@freebsd.org Sat Apr 21 13:48:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 700D6FA7154; Sat, 21 Apr 2018 13:48:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D4547B495; Sat, 21 Apr 2018 13:48:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C66A111635; Sat, 21 Apr 2018 13:48:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f50.google.com with SMTP id o123-v6so6252642lfe.8; Sat, 21 Apr 2018 06:48:42 -0700 (PDT) X-Gm-Message-State: ALQs6tD4YQgYAofoXGJREdez8WOKKqAbopZi/OLwt9DjB451uvZZM+jT OCir2iMlFmB9O59bcPglcAZgEqRJTzrJelw3R/g= X-Google-Smtp-Source: AB8JxZrRObniNcXMRDL8S2l1wngT1rFQjmrP6BltmzUWoMUlv+cCkU7CNpAAgxHGAPU1jWL38XT9KC9z/6H33ExDL78= X-Received: by 2002:a19:2902:: with SMTP id p2-v6mr1624876lfp.99.1524318521160; Sat, 21 Apr 2018 06:48:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Sat, 21 Apr 2018 06:48:20 -0700 (PDT) In-Reply-To: <201804211346.w3LDk7YM056252@repo.freebsd.org> References: <201804211346.w3LDk7YM056252@repo.freebsd.org> From: Kyle Evans Date: Sat, 21 Apr 2018 08:48:20 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332856 - head/usr.bin/grep To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 13:48:43 -0000 On Sat, Apr 21, 2018 at 8:46 AM, Kyle Evans 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.