Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/tools/coccinelle/commit.cocci # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / tools / coccinelle / commit.cocci` 53 lines ยท 1057 bytes Raw Blame History 1 @@ 2 expression c; 3 @@ 4 - &c->maybe_tree->object.oid 5 + get_commit_tree_oid(c) 6 7 @@ 8 expression c; 9 @@ 10 - c->maybe_tree->object.oid.hash 11 + get_commit_tree_oid(c)->hash 12 13 @@ 14 identifier f !~ "^set_commit_tree$"; 15 expression c; 16 expression s; 17 @@ 18 f(...) {<... 19 - c->maybe_tree = s 20 + set_commit_tree(c, s) 21 ...>} 22 23 // These excluded functions must access c->maybe_tree directly. 24 // Note that if c->maybe_tree is written somewhere outside of these 25 // functions, then the recommended transformation will be bogus with 26 // repo_get_commit_tree() on the LHS. 27 @@ 28 identifier f != { repo_get_commit_tree, get_commit_tree_in_graph_one, 29 load_tree_for_commit, set_commit_tree, repo_parse_commit_no_graph }; 30 expression c; 31 @@ 32 f(...) {<... 33 - c->maybe_tree 34 + repo_get_commit_tree(specify_the_right_repo_here, c) 35 ...>} 36 37 @@ 38 struct commit *c; 39 expression E; 40 @@ 41 ( 42 - c->generation = E; 43 + commit_graph_data_at(c)->generation = E; 44 | 45 - c->graph_pos = E; 46 + commit_graph_data_at(c)->graph_pos = E; 47 | 48 - c->generation 49 + commit_graph_generation(c) 50 | 51 - c->graph_pos 52 + commit_graph_position(c) 53 )