nd/sha1-name-c-wo-the-repository updates
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest34 patches 0 repliesNew
- v333 patches 11 repliesSuperseded
- v232 patches 6 repliesSuperseded
Patches in v4 No applies recorded yet
Reviews trailers per patch
None of the 34 patches has a Reviewed-by or Acked-by.
| Patch | SZEDER Gábor | Johannes Schindelin |
|---|---|---|
| 1/34 | ||
| 2/34 | ||
| 3/34 | ||
| 4/34 | ||
| 5/34 | ||
| 6/34 | ||
| 7/34 | ||
| 8/34 | ||
| 9/34 | ||
| 10/34 | ||
| 11/34 | Helped-by | Helped-by |
| 12/34 | ||
| 13/34 | ||
| 14/34 | ||
| 15/34 | ||
| 16/34 | ||
| 17/34 | ||
| 18/34 | ||
| 19/34 | ||
| 20/34 | ||
| 21/34 | ||
| 22/34 | ||
| 23/34 | ||
| 24/34 | ||
| 25/34 | ||
| 26/34 | ||
| 27/34 | ||
| 28/34 | ||
| 29/34 | ||
| 30/34 | ||
| 31/34 | ||
| 32/34 | ||
| 33/34 | ||
| 34/34 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 00/34] nd/sha1-name-c-wo-the-repository updates
v4 is all about updating commit.c and commit.cocci 11/33. I think I have incorporated all changes from v3 discussion. The changes are separated to a new patch 11/34 though, the old 11/33 is now 12/34.
Diff
commit-graph.c +7 -2
@@ -343,6 +343,11 @@ static void fill_commit_graph_info(struct commit *item, struct commit_graph *g, item->generation =get_be32 (commit_data + g->hash_len +8 ) >>2 ; } +static inline void set_commit_tree (struct commit *c,struct tree *t) +{ + c->maybe_tree = t; +} +static int fill_commit_in_graph (struct repository *r,struct commit *item,struct commit_graph *g,uint32_t pos)
@@ -356,7 +361,7 @@ static int fill_commit_in_graph(struct repository *r, item->object.parsed =1 ; item->graph_pos = pos; - item->maybe_tree =NULL ; +set_commit_tree (item,NULL ); date_high =get_be32 (commit_data + g->hash_len +8 ) &0x3 ; date_low =get_be32 (commit_data + g->hash_len +12 );
@@ -442,7 +447,7 @@ static struct tree *load_tree_for_commit(struct repository *r,GRAPH_DATA_WIDTH * (c->graph_pos);hashcpy (oid.hash, commit_data); - c->maybe_tree =lookup_tree (r, &oid); +set_commit_tree (c,lookup_tree (r, &oid));return c->maybe_tree; }
commit.c +7 -2
@@ -340,6 +340,11 @@ void free_commit_buffer(struct parsed_object_pool *pool, struct commit *commit) } } +static inline void set_commit_tree (struct commit *c,struct tree *t) +{ + c->maybe_tree = t; +} +struct tree *repo_get_commit_tree (struct repository *r,const struct commit *commit) {
@@ -359,7 +364,7 @@ struct object_id *get_commit_tree_oid(const struct commit *commit)void release_commit_memory (struct parsed_object_pool *pool,struct commit *c) { - c->maybe_tree =NULL ; +set_commit_tree (c,NULL ); c->index =0 ;free_commit_buffer (pool, c);free_commit_list (c->parents);
@@ -407,7 +412,7 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *bif (get_oid_hex (bufptr +5 , &parent) <0 )return error ("bad tree pointer in commit %s" ,oid_to_hex (&item->object.oid)); - item->maybe_tree =lookup_tree (r, &parent); +set_commit_tree (item,lookup_tree (r, &parent)); bufptr += tree_entry_len +1 ;/* "tree " + "hex sha1" + "\n" */ pptr = &item->parents;
contrib/coccinelle/commit.cocci +15 -10
@@ -10,20 +10,25 @@ expression c; - c->maybe_tree->object.oid.hash + get_commit_tree_oid(c)->hash +@@ +identifier f !~ "^set_commit_tree$"; +expression c; +expression s; +@@ + f(...) {<... +- c->maybe_tree = s ++ set_commit_tree(c, s) + ...>} + // These excluded functions must access c->maybe_tree direcly. +// Note that if c->maybe_tree is written somewhere outside of these +// functions, then the recommended transformation will be bogus with +// repo_get_commit_tree() on the LHS. @@ -identifier f !~ "^(repo_get_commit_tree|get_commit_tree_in_graph_one|load_tree_for_commit)$"; +identifier f !~ "^(repo_get_commit_tree|get_commit_tree_in_graph_one|load_tree_for_commit|set_commit_tree)$"; expression c; @@ f(...) {<... - c->maybe_tree -+ repo_get_commit_tree(the_repository, c) ++ repo_get_commit_tree(specify_the_right_repo_here, c) ...>} - -@@ -expression c; -expression r; -expression s; -@@ -- repo_get_commit_tree(r, c) = s -+ c->maybe_tree = s
merge-recursive.c +6 -1
@@ -163,6 +163,11 @@ static struct tree *shift_tree_object(struct repository *repo,return lookup_tree (repo, &shifted); } +static inline void set_commit_tree (struct commit *c,struct tree *t) +{ + c->maybe_tree = t; +} +static struct commit *make_virtual_commit (struct repository *repo,struct tree *tree,const char *comment)
@@ -170,7 +175,7 @@ static struct commit *make_virtual_commit(struct repository *repo,struct commit *commit =alloc_commit_node (repo);set_merge_remote_desc (commit, comment, (struct object *)commit); - commit->maybe_tree = tree; +set_commit_tree (commit, tree); commit->object.parsed =1 ;return commit; }
Nguyễn Thái Ngọc Duy (32):
packfile.c: add repo_approximate_object_count()
refs.c: add refs_ref_exists()
refs.c: add refs_shorten_unambiguous_ref()
refs.c: remove the_repo from substitute_branch_name() refs.c: remove the_repo from expand_ref()
refs.c: add repo_dwim_ref()
refs.c: add repo_dwim_log()
refs.c: remove the_repo from read_ref_at()
commit.cocci: refactor code, avoid double rewrite commit.c: add repo_get_commit_tree()
sha1-name.c: remove the_repo from sort_ambiguous() sha1-name.c: remove the_repo from find_abbrev_len_packed() sha1-name.c: add repo_find_unique_abbrev_r() sha1-name.c: store and use repo in struct disambiguate_state sha1-name.c: add repo_for_each_abbrev()
sha1-name.c: remove the_repo from get_short_oid() sha1-name.c: remove the_repo from interpret_nth_prior_checkout() sha1-name.c: remove the_repo from interpret_branch_mark() sha1-name.c: add repo_interpret_branch_name() sha1-name.c: remove the_repo from get_oid_oneline() sha1-name.c: remove the_repo from get_describe_name() sha1-name.c: remove the_repo from get_oid_basic() sha1-name.c: remove the_repo from get_oid_1() sha1-name.c: remove the_repo from handle_one_ref() sha1-name.c: remove the_repo from diagnose_invalid_index_path() sha1-name.c: remove the_repo from resolve_relative_path() sha1-name.c: remove the_repo from get_oid_with_context_1() sha1-name.c: add repo_get_oid()
submodule-config.c: use repo_get_oid for reading .gitmodules sha1-name.c: remove the_repo from maybe_die_on_misspelt_object_name sha1-name.c: remove the_repo from other get_oid_* sha1-name.c: remove the_repo from get_oid_mb()
SZEDER Gábor (2):
builtin rebase: use FREE_AND_NULL
builtin rebase: use oideq()
builtin/rebase.c | 5 +- builtin/show-branch.c | 6 +- cache.h | 50 ++-- commit-graph.c | 9 +- commit.c | 14 +- commit.h | 5 +- contrib/coccinelle/commit.cocci | 20 +- dir.c | 8 + dir.h | 4 +- merge-recursive.c | 7 +- packfile.c | 14 +- packfile.h | 3 +- refs.c | 71 ++++-- refs.h | 9 +- setup.c | 7 +- sha1-name.c | 388 ++++++++++++++++++----------- submodule-config.c | 20 +- t/t7814-grep-recurse-submodules.sh | 6 +- upload-pack.c | 2 +- 19 files changed, 407 insertions(+), 241 deletions(-)
Signature · 1 line
2.21.0.682.g30d2204636