Jacob Keller <jacob.e.kel...@intel.com> writes:

> From: Jacob Keller <jacob.kel...@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.kel...@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" ;-).

> 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?

Reply via email to