Re: Globbing for ignored branches?
- From
Jeff King <peff@peff.net>
- Date
- Jan 25, 2014, 20:02 UTC
- Message-ID
- <20140125200217.GA5608@sigill.intra.peff.net>
- In-Reply-To
- <20140125141542.GA402@x4>
On Sat, Jan 25, 2014 at 03:15:42PM +0100, Markus Trippelsdorf wrote:
Show 13 quoted lines
> Many thanks for the patch. It seems to work as advertised, but only if > the negative refspec appears on a separate line. For example: > > [remote "origin"] > url = git://gcc.gnu.org/git/gcc.git > fetch = +refs/heads/*:refs/remotes/origin/* > fetch = ^refs/remotes/hjl > > works fine, but: > > [remote "origin"] > url = git://gcc.gnu.org/git/gcc.git > fetch = +refs/heads/*:refs/remotes/origin/* ^refs/remotes/hjl
That does not have anything to do with the negative refspec. The config format is one refspec per "fetch" key, but you may have as many keys as you like. Doing:
[remote "origin"] fetch = refs/heads/a:refs/heads/a refs/heads/b:refs/heads/b
is similarly wrong. You need to do:
[remote "origin"] fetch = refs/heads/a:refs/heads/a fetch = refs/heads/b:refs/heads/b
instead. I believe that since space is forbidden in refnames, it should also be forbidden in refspecs, which means that we could interpret the first one as you expected without losing backwards compatibility. But I do not think there is any real advantage to doing so, aside from being more forgiving. I suspect the documentation in that area could be improved, though.
-Peff