fsck: report the ID of the error/warning

Some legacy code has objects with non-fatal fsck issues; To enable the
user to ignore those issues, let's print out the ID (e.g. when
encountering "missing-email", the user might want to call `git config
receive.fsck.missing-email warn`).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make fsck_ident() warn-friendly

When fsck_ident() identifies a problem with the ident, it should still
advance the pointer to the next line so that fsck can continue in the
case of a mere warning.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make fsck_commit() warn-friendly

When fsck_commit() identifies a problem with the commit, it should try
to make it possible to continue checking the commit object, in case the
user wants to demote the detected errors to mere warnings.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
fsck: handle multiple authors in commits specially

This problem has been detected in the wild, and is the primary reason
to introduce an option to demote certain fsck errors to warnings. Let's
offer to ignore this particular problem specifically.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make fsck_tag() warn-friendly

When fsck_tag() identifies a problem with the commit, it should try
to make it possible to continue checking the commit object, in case the
user wants to demote the detected errors to mere warnings.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a simple test for receive.fsck.*

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Disallow demoting grave fsck errors to warnings

Some kinds of errors are intrinsically unrecoverable (e.g. errors while
uncompressing objects). It does not make sense to allow demoting them to
mere warnings.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Optionally ignore specific fsck issues completely

"Abuse" the missing-email=warn test to verify that "ignore" is also
accepted and works correctly. And while at it, make sure that multiple
options work, too (they are passed to unpack-objects or index-pack as a
comma-separated command-line option).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
fsck: allow upgrading fsck warnings to errors

The 'invalid tag name' and 'missing tagger entry' warnings can now be
upgraded to errors by setting receive.fsck.invalid-tag-name and
receive.fsck.missing-tagger-entry to 'error'.

Incidentally, the missing tagger warning is now really shown as a warning
(as opposed to being reported with the "error:" prefix, as it used to be
the case before this commit).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Document the new receive.fsck.* options.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
fsck: support demoting errors to warnings

There are some legacy repositories out there which display non-fatal
errors with fsck. Let's make fsck useful with such repositories by
allowing users to ignore known issues, or at least demote those issues
to mere warnings (e.g. when a very early, hand-crafted commit has two
authors instead of one).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
WIP: Introduce fsck --quick

This option avoids unpacking each and all objects, and just verifies
the connectivity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
WIP: Introduce receive.fsck.skip-list

This config option can be used to specify the path to a file whose
lines list names of objects that should be ignored when fsck'ing
incoming objects.

This is extremely handy in case of legacy repositories where it would
cause more pain to change incorrect objects than to live with them
(e.g. a duplicate 'author' line in an early commit object).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>