Subject: Re: [RFC PATCH v2 1/4] object: remove "used" field from struct object

From: Junio C Hamano <[email-masked]>
Date: Thu, 20 Jul 2017 14:20:55 -0700

Jonathan Tan <[email-masked]> writes:

> The "used" field in struct object is only used by builtin/fsck. Remove
> that field and modify builtin/fsck to use a flag instead.
>
> Signed-off-by: Jonathan Tan <[email-masked]>
> ---
>  builtin/fsck.c | 24 ++++++++++++++----------
>  object.c       |  1 -
>  object.h       |  2 +-
>  3 files changed, 15 insertions(+), 12 deletions(-)

I vaguely recall trying to do this myself a few years ago.  We can
easily spot places within this file that does things like this:

> -	obj->flags = HAS_OBJ;

and correctly update it to this:

> +	obj->flags &= ~(REACHABLE | SEEN);
> +	obj->flags |= HAS_OBJ;

but I didn't do so because I was hesitant having to validate, and
having to maintain the invariant forever, that anything called from
these codepaths is always careful not to clobber the USED bit.

Looks like a reasonable preparatory clean-up that probably should be
doable and should be done way before the main part of the series to
me.  Will queue, together with your other fsck change.

Thanks.