Merge branch 'nd/commit-util-to-slab'
authorJunio C Hamano <gitster@pobox.com>
Mon, 25 Jun 2018 20:22:35 +0000 (13:22 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Jun 2018 20:22:35 +0000 (13:22 -0700)
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

14 files changed:
1  2 
blame.c
builtin/blame.c
builtin/describe.c
builtin/fast-export.c
builtin/log.c
builtin/merge.c
commit.c
commit.h
log-tree.c
merge-recursive.c
object.h
revision.c
sequencer.c
shallow.c
diff --cc blame.c
Simple merge
diff --cc builtin/blame.c
Simple merge
Simple merge
index 6c9768742fd4faecb3719e9c87997df3d490502a,5aaf5c8e59cf19dab157d655d680e09ea92d6d43..73d12c1020c4c13ff00210ad4eafc028bd33b322
@@@ -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 builtin/log.c
Simple merge
diff --cc builtin/merge.c
Simple merge
diff --cc commit.c
Simple merge
diff --cc commit.h
index c3af512f8b1b90b3963d0921f7ec0d0a43a2fcbe,4432458367f16ca23336737ee4d4e111aca85f06..e48f05dffcac2fc780386626701cdc64bd795076
+++ 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 log-tree.c
Simple merge
Simple merge
diff --cc object.h
Simple merge
diff --cc revision.c
Simple merge
diff --cc sequencer.c
index 4034c0461b5022dad01b25d824cdc4f47ee09d13,3b6d56d0856aa591ffdd703bb4d5e6f0bb6443fe..ee1f7b2df74572b1bff71436fa7961f47ac25378
  #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"
  
diff --cc shallow.c
Simple merge