All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: git@vger.kernel.org, Jacob Keller <jacob.keller@gmail.com>,
	Daniel Barkalow <barkalow@iabervon.iabervon.org>
Subject: Re: [PATCH v4] refs: loosen restrictions on wildcard '*' refspecs
Date: Wed, 22 Jul 2015 12:36:31 -0700	[thread overview]
Message-ID: <xmqq380grnls.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1437589929-14546-1-git-send-email-jacob.e.keller@intel.com> (Jacob Keller's message of "Wed, 22 Jul 2015 11:32:09 -0700")

Jacob Keller <jacob.e.keller@intel.com> writes:

> diff --git a/refs.c b/refs.c
> index ce8cd8d45001..a65f16fedaa0 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -20,11 +20,12 @@ struct ref_lock {
>   * 2: ., look for a preceding . to reject .. in refs
>   * 3: {, look for a preceding @ to reject @{ in refs
>   * 4: A bad character: ASCII control characters, "~", "^", ":" or SP
> + * 5: *, reject unless REFNAME_REFSPEC_PATTERN is set

The fact that this patch does not have to change the description for
'4:' is an indication that the original description for '4:' was
incomplete.  Otherwise the original would have listed "*" among
others like "~", "^", and this patch would have updated it.

This mixes a fix/cleanup with an enhancement.

>   */
>  static unsigned char refname_disposition[256] = {
>  	1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
>  	4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
> -	4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 2, 1,
> +	4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 2, 1,
>  	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 4,
>  	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>  	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 4, 0,
> @@ -71,11 +72,13 @@ static unsigned char refname_disposition[256] = {
>   * - any path component of it begins with ".", or
>   * - it has double dots "..", or
>   * - it has ASCII control character, "~", "^", ":" or SP, anywhere, or
> - * - it ends with a "/".
> - * - it ends with ".lock"
> - * - it contains a "\" (backslash)
> + * - it ends with a "/", or
> + * - it ends with ".lock", or
> + * - it contains a "\" (backslash), or
> + * - it contains a "@{" portion, or
> + * - it contains a '*' unless REFNAME_REFSPEC_PATTERN is set
>   */

This also mixes a fix/cleanup with an enhancement.  The original
should have had these ", or" but it didn't.

Can you split this patch into two, i.e.

 * [1/2] is to only clean-up the places these two hunks apply,
   without changing the behaviour at all.

   Please make sure that updated description for "4:" covers
   everything that is "a bad character".  We noticed the lack of '*'
   only because of your patch, but I do not know (and did not check)
   if that was the only thing that was missing.

 * [2/2] is what you really wanted to do with this patch,
   i.e. updating the entry for '*' in the disposition table and all
   changes outside the above two hunks.

Thanks.

      reply	other threads:[~2015-07-22 19:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-22 18:32 [PATCH v4] refs: loosen restrictions on wildcard '*' refspecs Jacob Keller
2015-07-22 19:36 ` Junio C Hamano [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq380grnls.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=barkalow@iabervon.iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jacob.keller@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.