mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
![Ævar Arnfjörð Bjarmason](/assets/img/avatar_default.png)
The <id> in the <rulename> part of the coccinelle syntax[1] is for our purposes there to declares if we have inter-dependencies between different rules. But such <id>'s must be unique within a given semantic patch file. As we'll be processing a concatenated version of our rules in the subsequent commit let's remove these names. They weren't being used for the semantic patches themselves, and equated to a short comment about the rule. Both the filename and context of the rules makes it clear what they're doing, so we're not gaining anything from keeping these. Retaining them goes against recommendations that "contrib/coccinelle/README" will be making in the subsequent commit. This leaves only one named rule in our sources, where it's needed for a "<id> <-> <extends> <id>" relationship: $ git -P grep '^@ ' -- contrib/coccinelle/ contrib/coccinelle/swap.cocci:@ swap @ contrib/coccinelle/swap.cocci:@ extends swap @ 1. https://coccinelle.gitlabpages.inria.fr/website/docs/main_grammar.html Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
17 lines
254 B
Plaintext
17 lines
254 B
Plaintext
@@
|
|
expression E;
|
|
struct hashmap_entry HME;
|
|
@@
|
|
- HME.hash = E;
|
|
+ hashmap_entry_init(&HME, E);
|
|
|
|
@@
|
|
identifier f !~ "^hashmap_entry_init$";
|
|
expression E;
|
|
struct hashmap_entry *HMEP;
|
|
@@
|
|
f(...) {<...
|
|
- HMEP->hash = E;
|
|
+ hashmap_entry_init(HMEP, E);
|
|
...>}
|