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

Re: [PATCH 2/2] tag: convert gpg_verify_tag to use struct object_id

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 13, 2017, 19:02 UTC
Message-ID
<xmqqzic8w472.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170713004415.5051-2-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
>  		if (fmt_pretty)
> -			pretty_print_ref(name, sha1, fmt_pretty);
> +			pretty_print_ref(name, oid.hash, fmt_pretty);

The next step would be to have pretty_print_ref() to take an oid; as there are only two callers to it, both of which pass oid->hash to it, that should be a small and conflict-free conversion.

>  
> -	type = sha1_object_info(sha1, NULL);
> +	type = sha1_object_info(oid->hash, NULL);

sha1_object_info() has a handful of callers that do not pass the pointer to the hash field in an existing oid object, but it does not look too bad as a candidate for conversion.

Show 6 quoted lines
>  	if (!buf)
>  		return error("%s: unable to read file.",
>  				name_to_report ?
>  				name_to_report :
> -				find_unique_abbrev(sha1, DEFAULT_ABBREV));
> +				find_unique_abbrev(oid->hash, DEFAULT_ABBREV));
So does find_unique_abbrev().
Overall both patches look good.  Thanks.
Previous: Stefan BellerNext: Junio C Hamano
Message 3 of 10 in “commit: convert lookup_commit_graft to struct object_id”
  1. 1/2 commit: convert lookup_commit_graft to struct object_idStefan Beller, Jul 13, 2017
  2. 2/2 tag: convert gpg_verify_tag to use struct object_idStefan Beller, Jul 13, 2017
  3. Junio C HamanoJul 13, 2017
  4. Junio C HamanoJul 13, 2017
  5. Stefan BellerJul 13, 2017
  6. Junio C HamanoJul 13, 2017
  7. Stefan BellerJul 13, 2017
  8. brian m. carlsonJul 13, 2017
  9. brian m. carlsonJul 13, 2017
  10. Junio C HamanoJul 13, 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.