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

Re: [PATCH] make sure parsed wildcard refspec ends with slash

From
Jeff King <peff@peff.net>
Date
Jul 28, 2008, 05:41 UTC
Message-ID
<20080728054151.GB7294@sigill.intra.peff.net>
In-Reply-To
<7vsktv3l9k.fsf_-_@gitster.siamese.dyndns.org>
On Sat, Jul 26, 2008 at 11:15:51PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> > I have a nagging suspicion that it might be a simpler and cleaner change
> > to change parse_refspec_internal() to keep the trailing slash, instead of
> > dropping it.  Then the check you added is not needed (the trailing slash
> > guarantees that the pattern matches at the hierarchy boundary), neither
> > any of the change in this patch.
> 
> This is the other variant, and it turns out that I was right.  Among the
> 64-18 = 46 new lines, 30 are from the new test file.  Two existing
> "matching part is followed by '/'" tests are removed.

Looks like you have already applied it, but I will chime in that of the two, I think this is the more sensible change. Stripping the '/' felt like a loss of information to me. IIRC, when "support only /*" was discussed, the thinking was "let's keep it tight now, and we can loosen it later." Keeping the '/' means that the code is much more sane if other globbing rules come in the future.

-Peff
Previous: Daniel BarkalowNext: Lee Marlow
Message 14 of 15 in “bash completion: Add completion for 'git help'”
  1. bash completion: Add completion for 'git help'Lee Marlow, Jul 23, 2008
  2. bash completion: Add completion for 'git help'Lee Marlow, Jul 24, 2008
  3. Shawn O. PearceJul 25, 2008
  4. Junio C HamanoJul 25, 2008
  5. fetch refspec foo/* matches foo*Jeff King, Jul 26, 2008
  6. Jeff KingJul 26, 2008
  7. Johannes SchindelinJul 26, 2008
  8. Jeff KingJul 28, 2008
  9. Junio C HamanoJul 28, 2008
  10. Jeff KingJul 28, 2008
  11. Junio C HamanoJul 27, 2008
  12. make sure parsed wildcard refspec ends with slashJunio C Hamano, Jul 27, 2008
  13. Daniel BarkalowJul 27, 2008
  14. Jeff KingJul 28, 2008
  15. bash completion: Add completion for 'git help'Lee Marlow, Jul 24, 2008

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.