project-fsck-status.sh: provide --no-full mode and options
commit3e83b2e36c3c79620ca1662bab71223fdc00847a
authorKyle J. McKay <mackyle@gmail.com>
Mon, 12 Feb 2018 23:18:20 +0000 (12 15:18 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 12 Feb 2018 23:18:20 +0000 (12 15:18 -0800)
treea1e819b420f3124853e6f36c98d953f8bb0bbd5e
parent181145220488a4b4fca3d0707630026a17e0d73b
project-fsck-status.sh: provide --no-full mode and options

The "git fsck" command provides a very exhaustive and complete check
of a repository.  It examines all objects for corruption and validity
as well as their interconnectivity.

Unfortunately, the "git fsck" command does not run particularly
quickly and has a tendency to be overly chatty about things that
do not impact remote client cloning, fetching or pushing.

Running "git fsck" on all Girocco repositories on a regular basis
imposes an unwanted load on the server not to mention the amount
of time needed for the check to run on all repositories.

Introduce a new "--full" option that requests the full "git fsck"
check and make the default a "--no-full" option that does not use
"git fsck" but detects common repository corruption issues such as
missing objects or most corrupted objects.

This new default "--no-full" option makes use of the
"git rev-list --objects --all" command to provide this capability.

As a result it runs much, much, much faster and is now suitable for
more regular use.  In addition it only reports truly fatal errors.
The only thing it does not detect is corrupted 'blob' objects (it
will detect missing 'blob' objects though).

Since it's unlikely that any 'blob' objects became corrupted since
they passed through 'transfer.fsckObjects=true' this provides a
welcome speed up while still finding all connectivity issues.

In addition to the "--full/--no-full" options, the ability to check
an explicitly given list of one or more projects has been added and
the ability to suppress the output (or email) if there are no errors
(-E) or no errors or warnings (-W).

Running weekly with the -m and -E options now becomes both reasonable
and desirable.  The load on the server will now be much, much less
and no email at all will be generated unless fatal problems are
detected.

The previous default behavior can still be accessed via the "--full"
option.

To further assist with use of this utility, a "-h/--help" option
has also now been implemented.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
cron/girocco
toolbox/reports/project-fsck-status.sh