fsck: introduce identifiers for fsck messages
commitc99ba492f1cc3e632ed12d46d7358effb6fa7f03
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 22 Jun 2015 15:25:09 +0000 (22 17:25 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Jun 2015 17:24:27 +0000 (22 10:24 -0700)
tree00ffb72c99d3354e9044971ace8b8164cf8adf44
parent22410549fc71b3973a61666f82b7c76317da5df0
fsck: introduce identifiers for fsck messages

Instead of specifying whether a message by the fsck machinery constitutes
an error or a warning, let's specify an identifier relating to the
concrete problem that was encountered. This is necessary for upcoming
support to be able to demote certain errors to warnings.

In the process, simplify the requirements on the calling code: instead of
having to handle full-blown varargs in every callback, we now send a
string buffer ready to be used by the callback.

We could use a simple enum for the message IDs here, but we want to
guarantee that the enum values are associated with the appropriate
message types (i.e. error or warning?). Besides, we want to introduce a
parser in the next commit that maps the string representation to the
enum value, hence we use the slightly ugly preprocessor construct that
is extensible for use with said parser.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c
fsck.c
fsck.h