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

Re: [PATCH 2/2] describe: Exclude --all --match=PATTERN

From: Greg Price <hidden>
Date: 2016-06-15 22:56:17

On Wed, Feb 27, 2013 at 12:20:07PM -0800, Junio C Hamano wrote:
Without "--all" the command considers only the annotated tags to
base the descripion on, and with "--all", a ref that is not
annotated tags can be used as a base, but with a lower priority (if
an annotated tag can describe a given commit, that tag is used).

So naïvely I would expect "--all" and "--match" to base the
description on refs that match the pattern without limiting the
choice of base to annotated tags, and refs that do not match the
given pattern should not appear even as the last resort.  It appears
to me that the current situation is (3).
Hmm.  It seems to me that "--all" says two things:

 (a) allow unannotated (rather than only annotated)

 (b) allow refs of any name (rather than only tags)

With "--match", particularly because the pattern always refers only to
tags, (b) is obliterated, and your proposed semantics are (a) plus a
sort of inverse of (b):

 (c) allow only refs matching the pattern

which is what "--match" means alone.  But if what we are going for is
(a) and (c), then we don't need "--all" for (a) -- we can get
precisely that with "--tags".  So these semantics make "--all --match=PAT"
equivalent to "--tags --match=PAT".

Given that, I think the user is better off if we reject "--all
--match" with an error message -- and perhaps the error message should
advise them to use "--tags" instead.  Otherwise we have "--all"
telling us (b) as well as (a), and "--match" countermanding (b) and
going precisely the other direction to (c).  If the user has written
that by hand, then they may be confused, and if the command line was
generated, perhaps called from a script, then I fear a bug in the
script is likely, what with the conflicting expectations expressed by
"--all" and "--match".

Patch below to suggest "--tags" in the error message.

Greg

Attachments

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