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

Re: [PATCH] git: add optional support for full pattern in fetch refspecs

From
Jacob Keller <jacob.keller@gmail.com>
Date
Jul 8, 2015, 04:47 UTC
Message-ID
<CA+P7+xpBrZPXFWpmzhkmHH7aAWiY-ews63_eex68kKc=ViHC3A@mail.gmail.com>
In-Reply-To
<xmqq615v1dlr.fsf@gitster.dls.corp.google.com>
On Tue, Jul 7, 2015 at 9:24 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> Jacob Keller <jacob.e.keller@intel.com> writes:
>
>> +remote.<name>.arbitrarypattern::
>> +     When set to true, fetching from this remote will allow arbitrary complex
>> +     patterns for the fetch refspecs. For example,
>> +     refs/tags/prefix-*:refs/tags/prefix-* will work as expected. Care should be
>> +     taken as you could fetch refs into names that don't exist on the remote and
>> +     may end up pushing them again later by accident.
>
> Bad name and explanation, unless you truly mean "arbitrary", like
> taking something like "refs/ta*/prefix-*-*-foo:refs/*".
>

I couldn't figure out what to use, and the original intent was to add an option.. but see below,

> More importantly, this is not "pattern"; you are talking about
> refspec, I think.
>

In this case the option was an additional modifier to the refspec_patterns, and I was talking about how the pattern could be slightly more arbitrary. I do agree it is a bad name, but i couldn't actually come up with anything better.

> But that probably does not matter.  I do not think this even needs
> to exist as an option.
>

Yes, I agree especially as I look at it more. I'll work up a patch version which does this without the option.

Show 12 quoted lines
> People's existing settings would not have anything other than an
> asterisk as a whole path component on each side (or no asterisk
> anywhere), and if they had an asterisk anywhere else they would have
> gotten an error and wouldn't have made any progress until they fixed
> it.  So if you loosen the current rule sligntly and tell them "If
> your refspec has an asterisk in it, then you must have one asterisk
> on each side of it. That rule hasn't changed. But your asterisks no
> longer have to be a whole path component", such a change would not
> hurt them.  Their existing setting that work would not notice, and
> existing users would not be relying on a refspec with an asterisk as
> part of a path component to error out.
>

Right. We aren't breaking anyones current functionality, just adding new functionality. We already check for a * in both sides, and my code will ensure only 1 star total. It will then work for the new somewhat more expanded patterns and we don't need an option.

I'll work up a v2.

Regards, Jake

Previous: Junio C Hamano
Message 3 of 3 in “git: add optional support for full pattern in fetch refspecs”
  1. git: add optional support for full pattern in fetch refspecsJacob Keller, Jul 7, 2015
  2. Junio C HamanoJul 8, 2015
  3. Jacob KellerJul 8, 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.