[Toybox] [PATCH] Support diff --no-dereference

enh enh at google.com
Thu Sep 5 11:12:47 PDT 2024


On Thu, Sep 5, 2024 at 10:38 AM Rob Landley <rob at landley.net> wrote:
>
> On 9/4/24 13:53, enh wrote:
> > thanks (and hope you're feeling better soon)!
>
> Me too. It's persistent.
>
> > unfortunately this breaks the toybox tests when run with a toybox
> > userspace. specifically:
> ...
> > +File - is a symbolic link while file file1 is a regular file
> ...
> > i guess the
> >
> >     if ((i = S_ISREG(TT.st[0].st_mode)) != S_ISREG(TT.st[1].st_mode)) {
> >       char *fidir[] = {"regular file", "symbolic link"};
> >       printf("File %s is a %s while file %s is a %s\n",
> >         files[0], fidir[!i], files[1], fidir[i]);
> >       TT.differ = 1;
> >     } else {
> >
> > behavior isn't the diffutils default?
>
> No, a symlink to a thing is the thing 99% of the time.
>
> Sheesh, often I'm doing "diff potato <(thingy)" and if diff gripes that one of
> those is a FIFO and the other isn't, something is very wrong. It very much
> should not care. (Why did gnu/dammit add this strange --no-dereference thing?
> That's not diff's JOB. But it definitely should not impact behavior when you
> didn't select it, that's just a regression. Test suite did its job catching that.)

plan 9's rc didn't have that, Android's mksh doesn't have that ...
there are other shells? :-)

(i wasn't able to easily answer the "when was it added to bash?"
question, but it's in macOS' 2007 bash 3.2, so it's not _that_ new...)

> Rob


More information about the Toybox mailing list