Re: [PATCH v3 5/5] describe: teach describe negative pattern matches
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 18, 2017, 20:17 UTC
- Message-ID
- <xmqqpojk86nh.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170118000930.5431-6-jacob.e.keller@intel.com>
Jacob Keller <jacob.e.keller@intel.com> writes:
Show 18 quoted lines
> From: Jacob Keller <jacob.keller@gmail.com> > > Teach git-describe the `--exclude` option which will allow specifying > a glob pattern of tags to ignore. This can be combined with the > `--match` patterns to enable more flexibility in determining which tags > to consider. > > For example, suppose you wish to find the first official release tag > that contains a certain commit. If we assume that official release tags > are of the form "v*" and pre-release candidates include "*rc*" in their > name, we can now find the first tag that introduces commit abcdef via: > > git describe --contains --match="v*" --exclude="*rc*" > > Add documentation and tests for this change. > > Signed-off-by: Jacob Keller <jacob.keller@gmail.com> > ---
The above is much better than 3/5 with a concrete example (compared to the vague "certain kinds of references"). It also does not have the "we check this first and then that" ;-).
Show 16 quoted lines
> diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt > index 7ad41e2f6ade..21a43b78924a 100644 > --- a/Documentation/git-describe.txt > +++ b/Documentation/git-describe.txt > @@ -88,6 +88,14 @@ OPTIONS > patterns will be considered. Use `--no-match` to clear and reset the > list of patterns. > > +--exclude <pattern>:: > + Do not consider tags matching the given `glob(7)` pattern, excluding > + the "refs/tags/" prefix. This can be used to narrow the tag space and > + find only tags matching some meaningful criteria. If given multiple > + times, a list of patterns will be accumulated and tags matching any > + of the patterns will be excluded. Use `--no-exclude` to clear and > + reset the list of patterns. > +
Similar to 3/5, perhaps we want to say something about interaction between this one and --match?