Re: [PATCH v4 2/5] name-rev: extend --refs to accept multiple patterns
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 19, 2017, 21:03 UTC
- Message-ID
- <xmqqk29qzrru.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170118230608.28030-3-jacob.e.keller@intel.com>
Jacob Keller <jacob.e.keller@intel.com> writes:
Show 12 quoted lines
> + if (data->ref_filters.nr) {
> + struct string_list_item *item;
> + int matched = 0;
> +
> + /* See if any of the patterns match. */
> + for_each_string_list_item(item, &data->ref_filters) {
> + /* Check every pattern even after we found a match so
> + * that we can determine when we should abbreviate the
> + * output. We will abbreviate the output when any of
> + * the patterns match a subpath, even if one of the
> + * patterns matches fully.
> + */This describe "what" we do, which we can read from the code. What I asked you to mention was "why", which cannot be read from the code.
/* * Check all patterns even after finding a match, * so that we can see if a match with a subpath exists. * When a user asked for 'refs/tags/v*' and 'v1.*', both * of which match, the user is showing her willingness * to accept a shortened output by having the 'v1.*' in * the acceptable refnames, so we shouldn't stop when seeing * 'refs/tags/v1.4' matches 'refs/tags/v*'. We should show * it as 'v1.4'. */
or something like that, perhaps?