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

Re: Globbing for ignored branches?

From
MTMarkus Trippelsdorf <markus@trippelsdorf.de>
Date
Jan 25, 2014, 14:15 UTC
Message-ID
<20140125141542.GA402@x4>
In-Reply-To
<20140125013433.GA22336@sigill.intra.peff.net>
On 2014.01.24 at 20:34 -0500, Jeff King wrote:
Show 19 quoted lines
> On Fri, Jan 24, 2014 at 01:08:42PM -0800, Junio C Hamano wrote:
> 
> > Not really.  You do not have to view it as "'not refs/heads/foo' is
> > affecting the previous '+refs/heads/*:refs/remotes/origin/*'".
> > 
> > You can think of two refspecs "refs/heads/foo refs/heads/bar" are
> > both affecting the "end result"; so far we only had a single way for
> > multiple refspecs to affect the end result and that was a "union".
> > Introducing "subtract" as another mode of combining is not too bad,
> > I would think, at the conceptual level.
> 
> > I tend to agree that "refs/heads/foo:" is being too cute and may be
> > confusing, at least if it will be the only way to express this in
> > the end-user-facing UI.  Even some people were confused enough on a
> > very sensible "push nothing to ref means deletion" to make us add
> > another explicit way, "push --delete", to ask for the same thing.
> 
> Agreed. I went with "^refs/heads/master" in the patch below, but I am
> open to other suggestions.

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 
doesn't. (I think this happens because bad_ref_char in refs.c checks for '^'.)
-- 
Markus
Previous: Jeff KingNext: Markus Trippelsdorf
Message 15 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.