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

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
Previous: Markus Trippelsdorf
Message 17 of 17 in “Globbing for ignored branches?”
  1. Markus TrippelsdorfJan 24, 2014
  2. Jim GarrisonJan 24, 2014
  3. Markus TrippelsdorfJan 24, 2014
  4. Markus TrippelsdorfJan 24, 2014
  5. Jeff KingJan 24, 2014
  6. Markus TrippelsdorfJan 24, 2014
  7. Jeff KingJan 24, 2014
  8. Junio C HamanoJan 24, 2014
  9. Markus TrippelsdorfJan 24, 2014
  10. Junio C HamanoJan 24, 2014
  11. Markus TrippelsdorfJan 24, 2014
  12. Jeff KingJan 24, 2014
  13. Junio C HamanoJan 24, 2014
  14. Jeff KingJan 25, 2014
  15. Markus TrippelsdorfJan 25, 2014
  16. Markus TrippelsdorfJan 25, 2014
  17. Jeff KingJan 25, 2014

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.