git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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?
Previous: Jacob KellerNext: Junio C Hamano
Message 7 of 11 in “extend git-describe pattern matching”
  1. 0/5 extend git-describe pattern matchingJacob Keller, Jan 18, 2017
  2. 5/5 describe: teach describe negative pattern matchesJacob Keller, Jan 18, 2017
  3. 4/5 describe: teach --match to accept multiple patternsJacob Keller, Jan 18, 2017
  4. 3/5 name-rev: add support to exclude refs by pattern matchJacob Keller, Jan 18, 2017
  5. Junio C HamanoJan 19, 2017
  6. 2/5 name-rev: extend --refs to accept multiple patternsJacob Keller, Jan 18, 2017
  7. Junio C HamanoJan 19, 2017
  8. Junio C HamanoJan 19, 2017
  9. Jacob KellerJan 19, 2017
  10. Jacob KellerJan 19, 2017
  11. 1/5 doc: add documentation for OPT_STRING_LISTJacob Keller, Jan 18, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.