From: Junio C Hamano <gitster@pobox.com>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: git@vger.kernel.org, Johannes Sixt <j6t@kdbg.org>,
Johannes Schindelin <johannes.schindelin@gmx.de>,
Jacob Keller <jacob.keller@gmail.com>
Subject: Re: [PATCH v4 2/5] name-rev: extend --refs to accept multiple patterns
Date: Thu, 19 Jan 2017 13:03:33 -0800 [thread overview]
Message-ID: <xmqqk29qzrru.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170118230608.28030-3-jacob.e.keller@intel.com> (Jacob Keller's message of "Wed, 18 Jan 2017 15:06:05 -0800")
Jacob Keller <jacob.e.keller@intel.com> writes:
> + 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?
next prev parent reply other threads:[~2017-01-19 21:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 23:06 [PATCH v4 0/5] extend git-describe pattern matching Jacob Keller
2017-01-18 23:06 ` [PATCH v4 1/5] doc: add documentation for OPT_STRING_LIST Jacob Keller
2017-01-18 23:06 ` [PATCH v4 2/5] name-rev: extend --refs to accept multiple patterns Jacob Keller
2017-01-19 21:03 ` Junio C Hamano [this message]
2017-01-19 21:06 ` Junio C Hamano
2017-01-19 23:36 ` Jacob Keller
2017-01-19 23:45 ` Jacob Keller
2017-01-18 23:06 ` [PATCH v4 3/5] name-rev: add support to exclude refs by pattern match Jacob Keller
2017-01-19 21:08 ` Junio C Hamano
2017-01-18 23:06 ` [PATCH v4 4/5] describe: teach --match to accept multiple patterns Jacob Keller
2017-01-18 23:06 ` [PATCH v4 5/5] describe: teach describe negative pattern matches Jacob Keller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqk29qzrru.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=jacob.e.keller@intel.com \
--cc=jacob.keller@gmail.com \
--cc=johannes.schindelin@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).