git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] revision: refactor ref_excludes to ref_visibility
@ 2023-06-21 19:35 John Cai via GitGitGadget
  2023-06-21 19:35 ` [PATCH 1/3] revision: rename " John Cai via GitGitGadget
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: John Cai via GitGitGadget @ 2023-06-21 19:35 UTC (permalink / raw)
  To: git; +Cc: John Cai

The ref_excludes API is used to tell which refs should be excluded. However,
there are times when we would want to add refs to explicitly include as
well. 4fe42f326e (pack-refs: teach pack-refs --include option, 2023-05-12)
taught pack-refs how to include certain refs, but did it in a more manual
way by keeping the ref patterns in a separate string list. Instead, we can
easily extend the ref_excludes API to include refs as well, since this use
case fits into the API nicely.

Refactor the API by renaming it to ref_visibility, and add a ref_visible()
helper that takes into account ref inclusion.

John Cai (3):
  revision: rename ref_excludes to ref_visibility
  revision: add ref_visible() helper
  pack-refs: use new ref_visible() helper

 builtin/pack-refs.c       | 20 ++++----
 builtin/rev-parse.c       | 18 +++----
 refs.h                    |  2 +-
 refs/files-backend.c      | 11 +----
 revision.c                | 98 +++++++++++++++++++++++----------------
 revision.h                | 37 +++++++++++----
 t/helper/test-ref-store.c |  8 ++--
 7 files changed, 111 insertions(+), 83 deletions(-)


base-commit: 6640c2d06d112675426cf436f0594f0e8c614848
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1515%2Fjohn-cai%2Fjc%2Frefactor-ref-excludes-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1515/john-cai/jc/refactor-ref-excludes-v1
Pull-Request: https://github.com/git/git/pull/1515
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-06-23 20:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21 19:35 [PATCH 0/3] revision: refactor ref_excludes to ref_visibility John Cai via GitGitGadget
2023-06-21 19:35 ` [PATCH 1/3] revision: rename " John Cai via GitGitGadget
2023-06-22 12:43   ` Taylor Blau
2023-06-21 19:35 ` [PATCH 2/3] revision: add ref_visible() helper John Cai via GitGitGadget
2023-06-21 19:35 ` [PATCH 3/3] pack-refs: use new " John Cai via GitGitGadget
2023-06-21 20:56 ` [PATCH 0/3] revision: refactor ref_excludes to ref_visibility Junio C Hamano
2023-06-22 12:52   ` Taylor Blau
2023-06-22 12:42 ` Taylor Blau
2023-06-22 12:49   ` Taylor Blau
2023-06-22 12:53     ` Taylor Blau
2023-06-22 12:58       ` Taylor Blau
2023-06-23 19:16     ` John Cai
2023-06-23 20:57       ` Junio C Hamano

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).