ref-filter: eliminate dummy ref_format to make the code cleaner
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | ref-filter: use list api to replace ref_sorting linked listbuiltin/ builtin/ builtin/ +3 more | +69 | 0 replies | |
| 2/8 | ref-filter: let parse_sorting_atom() use real ref_formatbuiltin/ builtin/ builtin/ +3 more | +24 | 0 replies | |
| 3/8 | ref-filter: add ref_format to ref_array_itembuiltin/ builtin/ builtin/ +3 more | +26 | 0 replies | |
| 4/8 | ref-filter: clean up verify_ref_format()ref-filter.c | +22 | 0 replies | |
| 5/8 | ref-filter: introduce symref_atom_parser()ref-filter.c | +8 | 0 replies | |
| 6/8 | ref-filter: remove grab_oid() functionref-filter.c | +9 | 0 replies | |
| 7/8 | ref-filter: add deref member to struct used_atomref-filter.c | +21 | 0 replies | |
| 8/8 | ref-filter: move need_symref, need_tagged into ref_formatref-filter.c ref-filter.h | +9 | 0 replies |
Reviews trailers per patch
None of the 8 patches has a Reviewed-by or Acked-by.
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/8] [GSOC] ref-filter: eliminate dummy ref_format to make the code cleaner
Note that there are these disadvantages in the ref-filter code:
1. Scattered state variables: need_tagged, need_symref are placed globally, need_color_reset_at_eol is placed inside ref_format.
2. parse_sorting_atom() uses a dummy ref_format, which causes us to need a lot of extra logic to check in verify_ref_format(), because dummy ref_format records some state, while truly ref_format does not.
3. struct ref_sorting uses a very strange singly linked list implementation, and there is a memory leak with it.
Therefore, the following modifications are made to make the logic of ref-filter cleaner:
1. Let ref_sorting use list api.
2. Eliminate dummy ref_format.
3. Add ref_format to ref_array_item.
4. Move the check in verify_ref_format() to atom parsing function.
5. Add deref member to used_atom.
6. Move need_symref, need_tagged to ref_format.
ZheNing Hu (8):
[GSOC] ref-filter: use list api to replace ref_sorting linked list [GSOC] ref-filter: let parse_sorting_atom() use real ref_format [GSOC] ref-filter: add ref_format to ref_array_item [GSOC] ref-filter: clean up verify_ref_format()
[GSOC] ref-filter: introduce symref_atom_parser() [GSOC] ref-filter: remove grab_oid() function
[GSOC] ref-filter: add deref member to struct used_atom [GSOC] ref-filter: move need_symref, need_tagged into ref_format
builtin/branch.c | 26 +++-- builtin/for-each-ref.c | 20 ++-- builtin/ls-remote.c | 18 ++-- builtin/tag.c | 24 +++-- ref-filter.c | 236 +++++++++++++++++++++-------------------- ref-filter.h | 20 ++-- 6 files changed, 185 insertions(+), 159 deletions(-)
base-commit: c4203212e360b25a1c69467b5a8437d45a373cac
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1025%2Fadlternative%2Fref-filter-code-clean-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1025/adlternative/ref-filter-code-clean-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1025
Signature · 1 line
gitgitgadget