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

Re: [PATCH 3/3] Add --contains flag to git tag

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 23, 2009, 01:18 UTC
Message-ID
<7v1vuu6cr6.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<497913EE.9040608@vivisimo.com>
Jake Goulding <goulding@vivisimo.com> writes:
Show 9 quoted lines
> @@ -34,7 +35,6 @@ static int show_reference(const char *refname, const
> unsigned char *sha1,
>  			  int flag, void *cb_data)
>  {
>  	struct tag_filter *filter = cb_data;
> -
>  	if (!fnmatch(filter->pattern, refname, 0)) {
>  		int i;
>  		unsigned long size;
Here you can see a long line wrapped.
What does this hunk have to do with adding --contains option anyway?
Show 12 quoted lines
> @@ -42,6 +42,18 @@ static int show_reference(const char *refname, const
> unsigned char *sha1,
>  		char *buf, *sp, *eol;
>  		size_t len;
>
> +		if (filter->with_commit) {
> +			struct commit *commit;
> +
> +			commit = lookup_commit_reference_gently(sha1, 1);
> +			if (!commit) {
> +				error("tag '%s' does not point at a commit", refname);
> +				return 0;

Drop this error() call, and just return silently. A tag that does not point at a commit is not an error at all.

Previous: Jake Goulding
Message 5 of 5 in “Make has_commit non-static”
  1. 2/3 Make has_commit non-staticJake Goulding, Jan 23, 2009
  2. Junio C HamanoJan 23, 2009
  3. Jake GouldingJan 23, 2009
  4. 3/3 Add --contains flag to git tagJake Goulding, Jan 23, 2009
  5. Junio C HamanoJan 23, 2009

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.