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

Re: [PATCH] patch-id: use oid_to_hex() to print multiple object IDs

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Dec 9, 2019, 02:06 UTC
Message-ID
<20191209020617.GB1334263@camp.crustytoothpaste.net>
In-Reply-To
<bebcac17-f560-bb73-9aee-72f944df7d95@web.de>
On 2019-12-07 at 19:16:51, René Scharfe wrote:
Show 20 quoted lines
> diff --git a/builtin/patch-id.c b/builtin/patch-id.c
> index 3059e525b8..822ffff51f 100644
> --- a/builtin/patch-id.c
> +++ b/builtin/patch-id.c
> @@ -5,13 +5,8 @@
> 
>  static void flush_current_id(int patchlen, struct object_id *id, struct object_id *result)
>  {
> -	char name[GIT_MAX_HEXSZ + 1];
> -
> -	if (!patchlen)
> -		return;
> -
> -	memcpy(name, oid_to_hex(id), the_hash_algo->hexsz + 1);
> -	printf("%s %s\n", oid_to_hex(result), name);
> +	if (patchlen)
> +		printf("%s %s\n", oid_to_hex(result), oid_to_hex(id));
>  }
> 
>  static int remove_space(char *line)
This seems like a nice cleanup to me.  Thanks for sending the patch.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: René Scharfe
Message 2 of 2 in “patch-id: use oid_to_hex() to print multiple object IDs”
  1. patch-id: use oid_to_hex() to print multiple object IDsRené Scharfe, Dec 7, 2019
  2. brian m. carlsonDec 9, 2019

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.