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

Re: [RFC] Refspec patterns with * in the middle

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Mar 2, 2009, 18:25 UTC
Message-ID
<alpine.LNX.1.00.0903021323180.19665@iabervon.org>
In-Reply-To
<76718490903021001h16009570p7ac8c66a8e8e1f90@mail.gmail.com>
On Mon, 2 Mar 2009, Jay Soffian wrote:
Show 41 quoted lines
> On Mon, Mar 2, 2009 at 12:08 PM, Junio C Hamano <gitster@pobox.com> wrote:
> > Daniel Barkalow <barkalow@iabervon.org> writes:
> >
> >> My use case is actually, more precisely:
> >>
> >> some/constant/stuff/$PROJ-$NUMBER/junk/my-proj
> >>
> >> Where $NUMBER is the version number, and $PROJ is usually, but not quite
> >> always "my-proj"; the exception being that it might be effectively a
> >> superproject. So I'd like to have:
> >>
> >>  fetch = some/constant/stuff/my-proj-*/junk/my-proj:refs/remotes/origin/*
> >
> > ... and expect "some/constant/stuff/my-proj-2.5/junk/my-proj" to be mapped
> > to "refs/remotes/origin/2.5"?  I think it does not look too bad.
> >
> >> But I can live with remote branches like "my-proj-2.4" instead of "2.4".
> >>
> >> I think it would make sense, and limit typo damage, to say that the * can
> >> only expand to something with a '/' in it if the star has a slash or the
> >> end of the string on each side.
> >
> > I do not understand what you mean by "* can only expand to something with
> > a '/' in it if ..." part.  None of the examples in your message have a
> > case where the asterisk matches across directory boundaries, and I thought
> > you would simply say "* does not match /" and be done with that.
> >
> > What scenario do you have in mind that wants to match a slash with an
> > asterisk?
> 
> I think he means the following are valid:
> 
>  - foo/bar/*/baz
>  - foo/bar/baz/*
> 
> But the following is not:
> 
>  - foo/bar*/baz
> 
> IOW, '*' can only appear as a non-terminating symbol if it is bounded
> by '/' on each side.

You have my criterion right, but I want that to be valid, but only match things like "foo/bar-something/baz", not "foo/bar-a/b/baz".

	-Daniel
*This .sig left intentionally blank*
Previous: Jay SoffianNext: Jay Soffian
Message 5 of 12 in “[RFC] Refspec patterns with * in the middle”
  1. Daniel BarkalowMar 1, 2009
  2. Jay SoffianMar 2, 2009
  3. Junio C HamanoMar 2, 2009
  4. Jay SoffianMar 2, 2009
  5. Daniel BarkalowMar 2, 2009
  6. Jay SoffianMar 2, 2009
  7. Junio C HamanoMar 2, 2009
  8. Jay SoffianMar 2, 2009
  9. Daniel BarkalowMar 2, 2009
  10. Junio C HamanoMar 2, 2009
  11. David KastrupMar 3, 2009
  12. Daniel BarkalowMar 2, 2009

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.