Skip to content

RFC ref-filter: introduce enum atom_type

ZheNing Hu via GitGitGadget git 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 RFC Latest2 patches 0 repliesNew
  2. v3 RFC2 patches 4 repliesSuperseded
  3. v2 RFC2 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC2 patches4 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ref-filter: add objectsize to used_atomref-filter.c+13 -60 replies
2/2ref-filter: introduce enum atom_typeref-filter.c+128 -690 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchJunio C HamanoChristian Couder
SeriesHelped-by Helped-by
1/2
2/2Helped-by Helped-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] [GSOC][RFC] ref-filter: introduce enum atom_type

Change from last version: fix some typo error and change commit message with Junio's help.

ZheNing Hu (2):
[GSOC] ref-filter: add objectsize to used_atom
[GSOC] ref-filter: introduce enum atom_type

 ref-filter.c | 214 +++++++++++++++++++++++++++++++++------------------
 1 file changed, 140 insertions(+), 74 deletions(-)

base-commit: 7e391989789db82983665667013a46eabc6fc570
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-951%2Fadlternative%2Fref-filter-atom-type-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-951/adlternative/ref-filter-atom-type-v4
Pull-Request: https://github.com/gitgitgadget/git/pull/951

Range-diff vs v3:

1: 91ca57c9d04a ! 1: 23fc04f7eb23 [GSOC] ref-filter: add objectsize to used_atom
@@ Metadata
## Commit message ##
[GSOC] ref-filter: add objectsize to used_atom

- Since "objectsize:size" is composed of two parts,
- "type:attribute". However, the original implementation
- did not decouple the two parts "type" and "attribute" well,
- we still need to judge separately whether the atom is
- "objectsize" or "objectsize:disk" in grab_common_values().
+ When the support for "objectsize:disk" was bolted onto the
+ existing support for "objectsize", it didn't follow the
+ usual pattern for handling "atomtype:modifier", which reads
+ the <modifier> part just once while parsing the format
+ string, and store the parsed result in the union in the
+ used_atom structure, so that the string form of it does not
+ have to be parsed over and over at runtime (e.g. in
+ grab_common_values()).

Add a new member objectsize to the union used_atom.u,
- so that we can separate the judgment of atom type from the
- judgment of atom attribute, This will bring scalability to
- atom %(objectsize).
+ so that we can separate the check of <modifier> from the
+ check of <atomtype>, this will bring scalability to atom
+ %(objectsize).

2: 43400cac58e7 ! 2: 50cfe1f0c6c1 [GSOC] ref-filter: introduce enum atom_type
@@ Commit message
used_atom.atom_type will record corresponding enum value from valid_atom entry index, and then in specific reference attribute filling step, only need to compare the value of
- the used_atom[i].atom_type to judge the atom type.
+ the used_atom[i].atom_type to check the atom type.

@@ ref-filter.c: static struct ref_to_worktree_map {
} ref_to_worktree_map;

+/*
-+ * The enum atom_type is used as the coordinates of valid_atom entry. ++ * The enum atom_type is used as the index of valid_atom array.
+ * In the atom parsing stage, it will be passed to used_atom.atom_type
-+ * as the identifier of the atom type. We can judge the type of used_atom ++ * as the identifier of the atom type. We can check the type of used_atom
+ * entry by if (used_atom[i].atom_type == ATOM_*).
+ */
+enum atom_type {

Signature · 1 line
gitgitgadget