git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4] refs: loosen restrictions on wildcard '*' refspecs

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 22, 2015, 19:36 UTC
Message-ID
<xmqq380grnls.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1437589929-14546-1-git-send-email-jacob.e.keller@intel.com>
Jacob Keller <jacob.e.keller@intel.com> writes:
Show 9 quoted lines
> 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.
Show 22 quoted lines
>   */
>  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.
Previous: Jacob Keller
Message 2 of 2 in “refs: loosen restrictions on wildcard '*' refspecs”
  1. refs: loosen restrictions on wildcard '*' refspecsJacob Keller, Jul 22, 2015
  2. Junio C HamanoJul 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.