git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/3] revision: refactor ref_excludes to ref_visibility

From
John Cai via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 21, 2023, 19:35 UTC
Message-ID
<pull.1515.git.git.1687376112.gitgitgadget@gmail.com>

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
Next: John Cai via GitGitGadget
Message 1 of 13 in “revision: refactor ref_excludes to ref_visibility”
  1. 0/3 revision: refactor ref_excludes to ref_visibilityJohn Cai via GitGitGadget, Jun 21, 2023
  2. 2/3 revision: add ref_visible() helperJohn Cai via GitGitGadget, Jun 21, 2023
  3. 1/3 revision: rename ref_excludes to ref_visibilityJohn Cai via GitGitGadget, Jun 21, 2023
  4. Taylor BlauJun 22, 2023
  5. 3/3 pack-refs: use new ref_visible() helperJohn Cai via GitGitGadget, Jun 21, 2023
  6. Junio C HamanoJun 21, 2023
  7. Taylor BlauJun 22, 2023
  8. Taylor BlauJun 22, 2023
  9. Taylor BlauJun 22, 2023
  10. Taylor BlauJun 22, 2023
  11. Taylor BlauJun 22, 2023
  12. John CaiJun 23, 2023
  13. Junio C HamanoJun 23, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.