From: Junio C Hamano Date: Mon, 25 Jun 2018 20:22:35 +0000 (-0700) Subject: Merge branch 'nd/commit-util-to-slab' X-Git-Tag: v2.19.0-rc0~193 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b3b2aaf0fd6c65f83d5f636bb177d96c88079b13 Merge branch 'nd/commit-util-to-slab' The in-core "commit" object had an all-purpose "void *util" field, which was tricky to use especially in library-ish part of the code. All of the existing uses of the field has been migrated to a more dedicated "commit-slab" mechanism and the field is eliminated. * nd/commit-util-to-slab: commit.h: delete 'util' field in struct commit merge: use commit-slab in merge remote desc instead of commit->util log: use commit-slab in prepare_bases() instead of commit->util show-branch: note about its object flags usage show-branch: use commit-slab for commit-name instead of commit->util name-rev: use commit-slab for rev-name instead of commit->util bisect.c: use commit-slab for commit weight instead of commit->util revision.c: use commit-slab for show_source sequencer.c: use commit-slab to associate todo items to commits sequencer.c: use commit-slab to mark seen commits shallow.c: use commit-slab for commit depth instead of commit->util describe: use commit-slab for commit names instead of commit->util blame: use commit-slab for blame suspects instead of commit->util commit-slab: support shared commit-slab commit-slab.h: code split --- b3b2aaf0fd6c65f83d5f636bb177d96c88079b13 diff --cc builtin/fast-export.c index 6c9768742f,5aaf5c8e59..73d12c1020 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@@ -36,8 -36,10 +37,9 @@@ static int use_done_feature static int no_data; static int full_tree; static struct string_list extra_refs = STRING_LIST_INIT_NODUP; -static struct refspec *refspecs; -static int refspecs_nr; +static struct refspec refspecs = REFSPEC_INIT_FETCH; static int anonymize; + static struct revision_sources revision_sources; static int parse_opt_signed_tag_mode(const struct option *opt, const char *arg, int unset) diff --cc commit.h index c3af512f8b,4432458367..e48f05dffc --- a/commit.h +++ b/commit.h @@@ -16,20 -16,18 +16,24 @@@ struct commit_list struct commit_list *next; }; + /* + * The size of this struct matters in full repo walk operations like + * 'git clone' or 'git gc'. Consider using commit-slab to attach data + * to a commit instead of adding new fields here. + */ struct commit { struct object object; - void *util; - unsigned int index; timestamp_t date; struct commit_list *parents; - struct tree *tree; + + /* + * If the commit is loaded from the commit-graph file, then this + * member may be NULL. Only access it through get_commit_tree() + * or get_commit_tree_oid(). + */ + struct tree *maybe_tree; uint32_t graph_pos; + unsigned int index; }; extern int save_commit_buffer; diff --cc sequencer.c index 4034c0461b,3b6d56d085..ee1f7b2df7 --- a/sequencer.c +++ b/sequencer.c @@@ -23,11 -23,7 +23,12 @@@ #include "hashmap.h" #include "notes-utils.h" #include "sigchain.h" +#include "unpack-trees.h" +#include "worktree.h" +#include "oidmap.h" +#include "oidset.h" + #include "commit-slab.h" +#include "alias.h" #define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"