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