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

[PATCH] cocci: retire is_null_sha1() rule

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 7, 2022, 21:50 UTC
Message-ID
<xmqq7d5suoqt.fsf@gitster.g>

Since 8d4d86b0 (cache: remove null_sha1, 2019-08-18) removed the is_null_sha1() function, rewrite rules to correct callers of the function to use is_null_oid() instead has become irrelevant, as any new callers of the function will get caught by the compiler much more quickly without spending cycles on Coccinelle.

Remove these rules.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/coccinelle/object_id.cocci | 12 ------------
 1 file changed, 12 deletions(-)
diff --git a/contrib/coccinelle/object_id.cocci b/contrib/coccinelle/object_id.cocci
index ddf4f22bd7..01f8d6935b 100644
--- a/contrib/coccinelle/object_id.cocci
+++ b/contrib/coccinelle/object_id.cocci
@@ -1,15 +1,3 @@
-@@
-struct object_id OID;
-@@
-- is_null_sha1(OID.hash)
-+ is_null_oid(&OID)
-
-@@
-struct object_id *OIDPTR;
-@@
-- is_null_sha1(OIDPTR->hash)
-+ is_null_oid(OIDPTR)
-
 @@
 struct object_id OID;
 @@
-- 
2.36.1-485-g100d6d3ce6
Message 1 of 1 in “cocci: retire is_null_sha1() rule”
  1. cocci: retire is_null_sha1() ruleJunio C Hamano, Jun 7, 2022

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.