Re: [PATCH v2 06/14] sequencer.c: use commit-slab to mark seen commits
- Date: Mon, 14 May 2018 13:17:09 +0900
- From: Junio C Hamano <gitster@xxxxxxxxx>
- Subject: Re: [PATCH v2 06/14] sequencer.c: use commit-slab to mark seen commits
Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> writes:
> It's done so that commit->util can be removed. See more explanation in
> the commit that removes commit->util.
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> sequencer.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
> diff --git a/sequencer.c b/sequencer.c
> index 4ce5120e77..6b785c6c5f 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -23,6 +23,7 @@
> #include "hashmap.h"
> #include "notes-utils.h"
> #include "sigchain.h"
> +#include "commit-slab.h"
> #define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"
> @@ -3160,6 +3161,7 @@ static enum check_level get_missing_commit_check_level(void)
> return CHECK_IGNORE;
> +define_commit_slab(commit_seen, uint8_t);
Because it makes no difference on any real platform that matters, it
is purely academic preference, but the user of this code does not
care about ensuring that commit-seen data is at lesat 8-bit wide,
which is where we should use uint8_t. We know this is a simple
yes/no field, so use of "uint8_t" here is quite misleading to the
readers. "unsigned char" or "char" would be a lot better.