Friday 29 May 2020

Re: Adjusting what fstypes df displays

On Friday, May 29 2020, Bryce Harrington wrote:

> On Fri, May 29, 2020 at 10:31:56AM -0400, Sergio Durigan Junior wrote:
>> On Friday, May 29 2020, Bryce Harrington wrote:
>> > I've drafted a POC implementation for df here:
>> >
>> > https://github.com/bryceharrington/coreutils/commit/cc372d778b44abcf81af42743a5174685f9bb4db
>>
>> Hey Bryce,
>>
>> Overall I like the idea of using an environment variable to control this
>> behaviour, but I feel compelled to raise the point of discoverability.
>>
>> If the distro ships a file under /etc/profile.d/ which silently sets
>> this variable for all users, and if the user is not aware of that, it
>> may take her some non-trivial effort to figure out why her tmpfs mount
>> is being listed by df.
>>
>> I'm sure you must have thought of that, but if you go forward with the
>> environment variable idea, extra care will need to be taken when writing
>> the documentation for it. Perhaps (and that's a big "perhaps"; I
>> haven't thought much about it) it's even worth mentioning somehow that
>> DF_EXCLUDE_FSTYPES is being used in the output of df,
>
> It's a good point. My plan is to mention it in --help, and also add an
> ENVIRONMENT section to the df man page, since at least to me that'd be
> the second and third places I'd look (the first being google
> obviously...) I notice that df has a couple other environment variables
> (POSIXLY_CORRECT and DF_BLOCK_SIZE) mentioned in --help but not the man
> page, which could go in as well.

Yeah, man page, info and --help come to mind when I think about
documenting this. I'd say it's worth putting something in the NEWS file
(from upstream) as well.

POSIXLY_CORRECT is accepted throughout coreutils, but unfortunately is
not documented everywhere.

I didn't know about DF_BLOCK_SIZE; I believe its existence sets a good
precedence for your proposal.

> This is probably too low-level to be worth including in the Groovy
> release notes, but I can propose a sentence or two just for some extra
> visibility.

Agreed.

>> or having a new
>> "--full-output" option (or some such) that would ignore the variable and
>> print everything.
>
> There is a 'df --all' option that sounds like it should suit that need.
> Thanks for raising this idea -- in testing it I notice the new code
> isn't honoring it. I'll add a check to skip the env var if -a,--all is
> specified.

Ah, there you go.

>> I kind of like the idea of a configuration file, but I agree that an
>> environment variable is more flexible. Also, I don't think the creation
>> of a configuration file would be justified for just this single option.
>
> Yeah, those were my thoughts as well. df itself doesn't currently use a
> config file, but I wonder if coreutils itself has something.

Yeah... I could not find anything, TBH. And I know you can control
other aspects of coreutils via environment variables (like LS_COLORS,
for example), so that seems like the way to go, indeed.

>> Let me know when you submit the patch upstream; I'm interested in
>> following the discussions :-).
>
> Sure thing,

Thanks!

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel