tytso / e2fsprogs

Ext2/3/4 file system utilities
http://ext4.wiki.kernel.org
374 stars 221 forks source link

fsck should be less verbose unless requested #128

Closed hongkongkiwi closed 4 months ago

hongkongkiwi commented 1 year ago

I would like to propose a simple change to make fsck less noisy and only show the version when "verbose" flag is set:

Index: b/e2fsck/unix.c
===================================================================
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -1448,7 +1448,7 @@ int main (int argc, char *argv[])
    }

    init_resource_track(&ctx->global_rtrack, NULL);
-   if (!(ctx->options & E2F_OPT_PREEN) || show_version_only)
+  if (verbose || show_version_only)
        log_err(ctx, "e2fsck %s (%s)\n", my_ver_string,
             my_ver_date);
tytso commented 4 months ago

Displaying the version number unconditionally was an explicit decision, because users are terrible at sending bug reports, and having the e2fsck version when they report problems is very helpful, and if we didn't report it in the e2fsck output, it's much less likely that they we will need to get back to them and ask "what version of e2fsck were you using" when you sent a bug report of the form "something broke".