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

Re: [PATCH] blame.c: replace instance of !oidcmp for oideq

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 9, 2020, 20:06 UTC
Message-ID
<xmqq5z8mvhou.fsf@gitster.c.googlers.com>
In-Reply-To
<20200909191746.GA2514794@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 19 quoted lines
>  @@
> -struct object_id *OIDPTR1;
> -struct object_id *OIDPTR2;
> +expression OIDPTR1;
> +expression OIDPTR2;
>  @@
>  - oidcmp(OIDPTR1, OIDPTR2) == 0
>  + oideq(OIDPTR1, OIDPTR2)
> @@ -71,8 +71,8 @@ expression E1, E2;
>    ...>}
>  
>  @@
> -struct object_id *OIDPTR1;
> -struct object_id *OIDPTR2;
> +expression *OIDPTR1;
> +expression *OIDPTR2;
>  @@
>  - oidcmp(OIDPTR1, OIDPTR2) != 0
>  + !oideq(OIDPTR1, OIDPTR2)

With an extra insight from the counter-example Réne pointed out in your message, I think the above two are safe but all the others are unsafe.

Previous: Junio C HamanoNext: René Scharfe
Message 13 of 14 in “blame.c: replace instance of !oidcmp for oideq”
  1. blame.c: replace instance of !oidcmp for oideqEdmundo Carmona Antoranz, Sep 7, 2020
  2. Edmundo Carmona AntoranzSep 7, 2020
  3. Edmundo Carmona AntoranzSep 8, 2020
  4. Derrick StoleeSep 8, 2020
  5. Jeff KingSep 9, 2020
  6. Edmundo Carmona AntoranzSep 9, 2020
  7. Jeff SmithSep 9, 2020
  8. Jeff KingSep 9, 2020
  9. Jeff KingSep 9, 2020
  10. René ScharfeSep 9, 2020
  11. Jeff KingSep 9, 2020
  12. Junio C HamanoSep 9, 2020
  13. Junio C HamanoSep 9, 2020
  14. René ScharfeSep 9, 2020

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.