Re: Globbing for ignored branches?

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: Globbing for ignored branches?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:59:44

Jeff King [off-list ref] writes:
On Fri, Jan 24, 2014 at 07:32:22PM +0100, Markus Trippelsdorf wrote:
quoted
quoted
However, you do have to specify each branch individually. You probably
want to say "all branches except X", and you cannot currently specify
a negative refspec like that.
Yes, that was the question I wanted to ask (, sorry for not formulating
it more clearly). 
Is this "negative refspec for branches" a feature that is planned for
the future?
It is something that has been talked about before, but I do not think
anybody is actively working on. It would probably not be too hard a
feature if you are interested in getting your feet wet in git
development. :)
The end result might be not so hard in the mechanical sense, but
designing the interface would be hard.  I do not offhand think of a
good way to do this.

Re: Globbing for ignored branches?

From: Markus Trippelsdorf <hidden>
Date: 2016-06-15 22:59:44

On 2014.01.24 at 12:00 -0800, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
On Fri, Jan 24, 2014 at 07:32:22PM +0100, Markus Trippelsdorf wrote:
quoted
quoted
However, you do have to specify each branch individually. You probably
want to say "all branches except X", and you cannot currently specify
a negative refspec like that.
Yes, that was the question I wanted to ask (, sorry for not formulating
it more clearly). 
Is this "negative refspec for branches" a feature that is planned for
the future?
It is something that has been talked about before, but I do not think
anybody is actively working on. It would probably not be too hard a
feature if you are interested in getting your feet wet in git
development. :)
The end result might be not so hard in the mechanical sense, but
designing the interface would be hard.  I do not offhand think of a
good way to do this.
I don't know if the in-tree regex engine supports negative lookaheads.
If it does, then something like the following should work (to use my
"hjl" example):

^(.(?!hjl))*

-- 
Markus

Re: Globbing for ignored branches?

From: Jeff King <hidden>
Date: 2016-06-15 22:59:44

On Fri, Jan 24, 2014 at 12:00:16PM -0800, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
On Fri, Jan 24, 2014 at 07:32:22PM +0100, Markus Trippelsdorf wrote:
quoted
quoted
However, you do have to specify each branch individually. You probably
want to say "all branches except X", and you cannot currently specify
a negative refspec like that.
[...]
The end result might be not so hard in the mechanical sense, but
designing the interface would be hard.  I do not offhand think of a
good way to do this.
I had imagined a "not" token at the front of the refspec, like:

  git fetch origin +refs/heads/*:refs/remotes/origin/* ^refs/heads/foo

In this case, a colon in the refspec would be an error. An alternative
would be:

  git fetch origin +refs/heads/*:refs/remotes/origin/* refs/heads/foo:

I.e., to say "put foo to nowhere". But generally refspecs do not affect
each other. So "refs/heads/foo:refs/heads/bar" would generally work _in
addition_ to the other refspec. Making the "null destination" work
differently might be confusing.

I dunno. I have not thought very hard on the topic, so maybe there are
some subtle cases I am missing.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help