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

Re: refspecs with '*' as part of pattern

From
Jacob Keller <jacob.keller@gmail.com>
Date
Jul 7, 2015, 23:20 UTC
Message-ID
<CA+P7+xoobt_W11ruGVmJ0hzTEqNcdqk=cgRUAuYqSchPJcTsrw@mail.gmail.com>
In-Reply-To
<xmqqbnfo3paa.fsf@gitster.dls.corp.google.com>
On Tue, Jul 7, 2015 at 9:28 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 29 quoted lines
> Daniel Barkalow <barkalow@iabervon.iabervon.org> writes:
>
>> On Mon, 6 Jul 2015, Junio C Hamano wrote:
>>
>>> I cannot seem to be able to find related discussions around that
>>> patch, so this is only my guess, but I suspect that this is to
>>> discourage people from doing something like:
>>>
>>>      refs/tags/*:refs/tags/foo-*
>>>
>>> which would open can of worms (e.g. imagine you fetch with that
>>> pathspec and then push with refs/tags/*:refs/tags/* back there;
>>> would you now get foo-v1.0.0 and foo-foo-v1.0.0 for their v1.0.0
>>> tag?) we'd prefer not having to worry about.
>>
>> That wouldn't be it, since refs/tags/*:refs/tags/foo/* would have the same
>> problem, assuming you didn't set up the push refspec carefully.
>
> Thanks, I was wondering where you were ;-)  Nice to hear from you
> from time to time.
>
>> I think it was mostly that it would be too easy to accidentally do
>> something you don't want by having some other character instead of a
>> slash, like refs/heads/*:refs/heads-*.
>
> Hmm, interesting thought.
>
> But refs/heads/*:refs/heade/* would not be saved, so I do not think
> that is it, either.

In this case, I'm more in favor of just allowing these refs because the user already has to manually change the refspecs, which is something many users will never do. I also think that given the above comments, we're not really protecting the user from anything extra... aside from adding more pain because the globs don't work as expected.

I did submit a patch (from my @intel.com address since I can't seem to get git-for-windows to send from my home computer) but I am willing to re-work to drop the setting if everyone is ok with that...

Thoughts?

Regards, Jake

Previous: Junio C Hamano
Message 8 of 8 in “refspecs with '*' as part of pattern”
  1. Jacob KellerJul 6, 2015
  2. Junio C HamanoJul 6, 2015
  3. Jacob KellerJul 6, 2015
  4. Daniel BarkalowJul 7, 2015
  5. Jacob KellerJul 7, 2015
  6. Jacob KellerJul 7, 2015
  7. Junio C HamanoJul 7, 2015
  8. Jacob KellerJul 7, 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.