Re: [PATCH v5 09/14] commit.h: add wrapped tags in commit struct
From: Teng Long <hidden>
Date: 2021-09-02 13:01:52
ZheNing Hu wrote:
/*
* 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;
timestamp_t date;
struct commit_list *parents;
/*
* If the commit is loaded from the commit-graph file, then this
* member may be NULL. Only access it through repo_get_commit_tree()
* or get_commit_tree_oid().
*/
struct tree *maybe_tree;
unsigned int index;
};
According to the instructions above, I wonder if you should use "commit_slab" to
store part of the data related to the commit object instead of
modifying the member
of struct commit itself?
See:
https://github.com/git/git/blob/master/commit-slab.h
https://github.com/git/git/blob/master/commit-slab-impl.h
https://github.com/git/git/blob/master/commit-slab-decl.h
https://lore.kernel.org/git/CAOLTT8Q8BEKCVwPDypW1w66P9_xP7QC0T-CnLqamqAL4haGzwA@mail.gmail.com/ (local)Awesome! Maybe it's what I really need now, I will make a try. Thanks(比心).