From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Thomas Gummerer <t.gummerer@gmail.com>, git@vger.kernel.org
Subject: Re: [RFC v2] refs: strip out not allowed flags from ref_transaction_update
Date: Fri, 22 Sep 2017 13:23:07 +0900 [thread overview]
Message-ID: <xmqq8th7l5uc.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <4ae6cb35-ecf4-e2a2-302d-95e1442cf101@alum.mit.edu> (Michael Haggerty's message of "Thu, 21 Sep 2017 10:40:43 +0200")
Michael Haggerty <mhagger@alum.mit.edu> writes:
> I wouldn't worry too much about this anomaly. `REF_ISPRUNING` is an ugly
> internal kludge, but allowing it in the mask doesn't make anything worse.
>
>> refs.c | 2 ++
>> refs.h | 8 ++++++++
>> 2 files changed, 10 insertions(+)
>>
>> diff --git a/refs.c b/refs.c
>> index ba22f4acef..fad61be1da 100644
>> --- a/refs.c
>> +++ b/refs.c
>> @@ -921,6 +921,8 @@ int ref_transaction_update(struct ref_transaction *transaction,
>> return -1;
>> }
>>
>> + flags &= REF_TRANSACTION_UPDATE_ALLOWED_FLAGS;
>> +
>
> I would advocate considering it a bug if the caller passes in options
> that we are going to ignore anyway:
>
> if (flags & ~REF_TRANSACTION_UPDATE_ALLOWED_FLAGS)
> BUG("illegal flags %x in ref_transaction_update", flags);
It sounds like a sensible thing to do. Thanks.
next prev parent reply other threads:[~2017-09-22 4:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-04 20:05 [PATCH] refs: make sure we never pass NULL to hashcpy Thomas Gummerer
2017-09-06 1:26 ` Junio C Hamano
2017-09-06 20:32 ` Thomas Gummerer
2017-09-07 7:26 ` Michael Haggerty
2017-09-07 20:39 ` Thomas Gummerer
2017-09-08 0:46 ` Junio C Hamano
2017-09-08 15:08 ` Michael Haggerty
2017-09-08 17:15 ` Junio C Hamano
2017-09-12 22:59 ` [RFC v2] refs: strip out not allowed flags from ref_transaction_update Thomas Gummerer
2017-09-21 8:40 ` Michael Haggerty
2017-09-22 4:23 ` Junio C Hamano [this message]
2017-09-24 20:45 ` Thomas Gummerer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq8th7l5uc.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mhagger@alum.mit.edu \
--cc=t.gummerer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).