git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "ZheNing Hu via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Christian Couder" <christian.couder@gmail.com>,
	"Hariom Verma" <hariom18599@gmail.com>,
	"Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Jeff King" <peff@peff.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Philip Oakley" <philipoakley@iee.email>,
	"ZheNing Hu" <adlternative@gmail.com>
Subject: [PATCH 0/8] [GSOC] ref-filter: eliminate dummy ref_format to make the code cleaner
Date: Wed, 25 Aug 2021 09:08:44 +0000	[thread overview]
Message-ID: <pull.1025.git.1629882532.gitgitgadget@gmail.com> (raw)

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
-- 
gitgitgadget

             reply	other threads:[~2021-08-25  9:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  9:08 ZheNing Hu via GitGitGadget [this message]
2021-08-25  9:08 ` [PATCH 1/8] [GSOC] ref-filter: use list api to replace ref_sorting linked list ZheNing Hu via GitGitGadget
2021-08-25  9:08 ` [PATCH 2/8] [GSOC] ref-filter: let parse_sorting_atom() use real ref_format ZheNing Hu via GitGitGadget
2021-08-25  9:08 ` [PATCH 3/8] [GSOC] ref-filter: add ref_format to ref_array_item ZheNing Hu via GitGitGadget
2021-08-25  9:08 ` [PATCH 4/8] [GSOC] ref-filter: clean up verify_ref_format() ZheNing Hu via GitGitGadget
2021-08-25  9:08 ` [PATCH 5/8] [GSOC] ref-filter: introduce symref_atom_parser() ZheNing Hu via GitGitGadget
2021-08-25  9:08 ` [PATCH 6/8] [GSOC] ref-filter: remove grab_oid() function ZheNing Hu via GitGitGadget
2021-08-25  9:08 ` [PATCH 7/8] [GSOC] ref-filter: add deref member to struct used_atom ZheNing Hu via GitGitGadget
2021-08-25  9:08 ` [PATCH 8/8] [GSOC] ref-filter: move need_symref, need_tagged into ref_format ZheNing Hu via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1025.git.1629882532.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=adlternative@gmail.com \
    --cc=avarab@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hariom18599@gmail.com \
    --cc=peff@peff.net \
    --cc=philipoakley@iee.email \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).