On Sat, Jan 25, 2014 at 03:15:42PM +0100, Markus Trippelsdorf wrote:

> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to