Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jan 2020 08:05:21 -0600
From:      Kyle Evans <self@kyle-evans.net>
To:        Li-Wen Hsu <lwhsu@freebsd.org>
Cc:        Mark Johnston <markj@freebsd.org>, src-committers <src-committers@freebsd.org>,  svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r356695 - head/usr.bin/diff
Message-ID:  <CACNAnaF26mtvy_afLa0aveqc3h1GW1JGaNqOrqcwofQeoS%2BkdA@mail.gmail.com>
In-Reply-To: <CAKBkRUz1ARm6jVw%2B%2BC=apEx4zG8FpnVpHE9u1PSatPO1zCiddg@mail.gmail.com>
References:  <202001131829.00DITmev016747@repo.freebsd.org> <CAKBkRUz1ARm6jVw%2B%2BC=apEx4zG8FpnVpHE9u1PSatPO1zCiddg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 14, 2020 at 6:12 AM Li-Wen Hsu <lwhsu@freebsd.org> wrote:
>
> On Tue, Jan 14, 2020 at 2:29 AM Mark Johnston <markj@freebsd.org> wrote:
> >
> > Author: markj
> > Date: Mon Jan 13 18:29:47 2020
> > New Revision: 356695
> > URL: https://svnweb.freebsd.org/changeset/base/356695
> >
> > Log:
> >   Optimize diff -q.
> >
> >   Once we know whether the files differ, we don't need to do any further
> >   work.
> >
> >   PR:           242828
> >   Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com> (original version)
> >   Reviewed by:  bapt, kevans
> >   MFC after:    1 week
> >   Differential Revision:        https://reviews.freebsd.org/D23152
> >
> > Modified:
> >   head/usr.bin/diff/diffreg.c
> >
> > Modified: head/usr.bin/diff/diffreg.c
> > ==============================================================================
> > --- head/usr.bin/diff/diffreg.c Mon Jan 13 18:26:27 2020        (r356694)
> > +++ head/usr.bin/diff/diffreg.c Mon Jan 13 18:29:47 2020        (r356695)
> > @@ -349,6 +349,11 @@ diffreg(char *file1, char *file2, int flags, int capsi
> >                 goto closem;
> >         }
> >
> > +       if (diff_format == D_BRIEF) {
> > +               rval = D_DIFFER;
> > +               status |= 1;
> > +               goto closem;
> > +       }
> >         if ((flags & D_FORCEASCII) == 0 &&
> >             (!asciifile(f1) || !asciifile(f2))) {
> >                 rval = D_BINARY;
>
> Hi Mark,
>
> This one seems breaks test case usr.sbin.etcupdate.fbsdid_test.main:
>
> https://ci.freebsd.org/job/FreeBSD-head-amd64-test/13920/testReport/junit/usr.sbin.etcupdate/fbsdid_test/main/
>
> Revert this can get the case pass. Can you check if the code or the
> test needs to be fixed?
>

Whoops... that was a bit of an oversight. We can only short-circuit if
ignore_pats == NULL, otherwise we need to regress back to doing
line-by-line comparison. That should still see a benefit for the
majority of cases, though, I would think.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaF26mtvy_afLa0aveqc3h1GW1JGaNqOrqcwofQeoS%2BkdA>