Re: [PATCH 02/11] refs: remove the gap in the REF_* constant values
- From
Stefan Beller <sbeller@google.com>
- Date
- Feb 9, 2015, 18:14 UTC
- Message-ID
- <CAGZ79kbcgv236MxzNpQ3H6E9y-v_SYaYettzXUjr9311DyF-ig@mail.gmail.com>
- In-Reply-To
- <1423412045-15616-3-git-send-email-mhagger@alum.mit.edu>
On Sun, Feb 8, 2015 at 8:13 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 19 quoted lines
> There is no reason to "reserve" a gap between the public and private
> flags values.
>
> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
> ---
> refs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/refs.c b/refs.c
> index cd5208b..477a5b3 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -44,7 +44,8 @@ static unsigned char refname_disposition[256] = {
> * Used as a flag to ref_transaction_delete when a loose ref is being
> * pruned.
> */
> -#define REF_ISPRUNING 0x0100
> +#define REF_ISPRUNING 0x04
> +I'm ok with that change, though I remember Duy had once started to create a table in a header file documenting all positions of flags (e.g foo.c would use 1<<{1,2,3,7}, and bar.c had 1<<{1,2,5,26} in use). I wonder if we should start a discussion on that topic. I think it makes sense to have a central place documenting all the flags (specially their bit allocation), but this one is only in one c file, so we're really unlikely to break something by having different defines pointing at the same bit.