threads / discuss / 35511

Refspec wildcards for remotes require trailing slash

Subject: Refspec wildcards for remotes require trailing slash

## tl;dr

3 messages between Dec 10, 2013 and Dec 10, 2013.

replies: 2people: 2as markdown or json

Monte Goulding· Dec 10, 2013, 02:32 UTC · lore
Hi
I came across this issue the other day while trying to optimise a fetch to a repo with release branches named release-X.X.X. I wanted to just fetch just those branches but because of the trailing slash rule I couldn't. The following StackOverflow post has details of the issue:
http://stackoverflow.com/questions/20450003/is-it-possible-to-use-filters-in-refspec-in-places-other-than-directory-namespac
The trailing slash rule appears to be introduced in 46220ca and further tightened in b2a5627
Before I go ahead and look at what needs to be done for a patch I thought it would be polite to ask if there is any reasoning behind the trailing slash rule that I'm missing? Or if you are interested in changing this behavior at all.
Cheers
Monte
Junio C Hamano· Dec 10, 2013, 19:14 UTC · re: Monte Goulding · lore

Re: Refspec wildcards for remotes require trailing slash

Monte Goulding <monte@sweattechnologies.com> writes:
> Before I go ahead and look at what needs to be done for a patch I
> thought it would be polite to ask if there is any reasoning behind
> the trailing slash rule that I'm missing? Or if you are interested
> in changing this behavior at all.

The log messages of the two commits you cited in your message says that "refs/a/b/* should not match refs/a/b1, but the old code mistakenly allowed to". As long that fix is not broken, allowing "refs/a/b*" to match "refs/a/b1" is OK, I would think.

But it is debatable if such a change should allow "refs/a/b*" to match "refs/a/b/2". Arguments can be made in both ways, and my knee-jerk reaction is it shouldn't.

Monte Goulding· Dec 10, 2013, 19:59 UTC · re: Junio C Hamano · lore

Re: Refspec wildcards for remotes require trailing slash

On 11/12/2013, at 6:14 AM, Junio C Hamano <gitster@pobox.com> wrote:
> But it is debatable if such a change should allow "refs/a/b*" to
> match "refs/a/b/2".  Arguments can be made in both ways, and my
> knee-jerk reaction is it shouldn't.
Hmm.. for-each-ref doesn't match it but ls-remote does
Sorry: forgot to CC the list

← back to recent threads