Thread (2 messages) 2 messages, 2 authors, 2016-06-15

Re: [RFC/PATCH] tag: make list exclude !<pattern>

flat view

From: Michael Haggerty <hidden>
Date: 2016-06-15 22:53:03

On 02/11/2012 09:13 AM, Junio C Hamano wrote:
Michael Haggerty [off-list ref] writes:
quoted
The proposal, amended to use "^" instead of "!", is that

    git for-each-ref A B ^C

should mean "the reference names A and B but not C".  Therefore, the command

    git rev-list $(git for-each-ref A B ^C)

, which consistency suggests should do the same thing as the first
command,...
That is an utter rubbish that does not even deserve a response.

Your argument is like saying

     git for-each-ref A

and

     git for-each-ref $(git rev-parse A)

should somehow magically produce the same (or related) result. The
for-each-ref command operates on refname patterns, while rev-list and
rev-parse takes object names.
Of *course* they operate on different namespaces.  But part of the way
that revisions are selected using rev-list is by *selecting or excluding
refnames* from which it should crawl.  How long do you think it will be
before somebody asks for rev-list to be able to crawl from a set of
branches *except for those that match some pattern*?  (Hint: I more or
less asked for this feature in the "rubbish" email that you quoted.)  At
that point we will have to say one of the following:

"Your suggestion is utter rubbish; just type 'git rev-list $(git
for-each-ref A B ^C)'."

This is an acceptable (though somewhat verbose) answer for the Unix
command line; for msgit users it is useless, and it probably cannot be
used in non-command-line scenarios like the gitk "edit view" dialog.

"Sure, but we have to invent yet another syntax because the one used by
for-each-ref conflicts with the existing syntax of rev-list."  This
would be the standard git project practice of letting the UI accrete
into an ever more incomprehensible mess.

That is why I suggest that we choose a new syntax *now* for for-each-ref
(and "branch --list", "tag --list", etc) so that the same syntax can be
used later in rev-list, rev-parse, etc.

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help