Skip to content

receive-pack: only use visible refs for connectivity check

Patrick Steinhardt git 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest7 patches 2 repliesIn review
  2. v57 patches 6 repliesSuperseded
  3. v46 patches 6 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v36 patches11 repliesSuperseded
v23 patches7 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7refs: fix memory leak when parsing hideRefs configrefs.c+1 -10 replies
2/7refs: get rid of global list of hidden refsbuiltin/receive-pack.c ls-refs.c refs.c +2 more+39 -310 replies
3/7revision: move together exclusion-related functionsrevision.c+26 -260 replies
4/7revision: introduce struct to handle exclusionsbuiltin/rev-parse.c revision.c revision.h+47 -360 replies
5/7revision: add new parameter to exclude hidden refsDocumentation/rev-list-options.txt builtin/rev-list.c revision.c +2 more+241 -10 replies
6/7rev-parse: add `--exclude-hidden=` optionDocumentation/git-rev-parse.txt builtin/rev-parse.c t/t6018-rev-list-glob.sh+57 -00 replies
7/7receive-pack: only use visible refs for connectivity checkbuiltin/receive-pack.c connected.c connected.h+12 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 0/7] receive-pack: only use visible refs for connectivity check

Hi,

this is the sixth version of my patch series that tries to improve performance of the connectivity check by only considering preexisting refs as uninteresting that could actually have been advertised to the client.

There are only two changes in this version compared to v5:

- A fix to the test setup in commit 5/7 so that tests pass when GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main.

- A typo fix in the commit message of patch 6/7.

Patrick

Patrick Steinhardt (7):
refs: fix memory leak when parsing hideRefs config
refs: get rid of global list of hidden refs
revision: move together exclusion-related functions
revision: introduce struct to handle exclusions
revision: add new parameter to exclude hidden refs
rev-parse: add --exclude-hidden= option
receive-pack: only use visible refs for connectivity check

 Documentation/git-rev-parse.txt    |   7 ++
 Documentation/rev-list-options.txt |   7 ++
 builtin/receive-pack.c             |  10 +-
 builtin/rev-list.c                 |   1 +
 builtin/rev-parse.c                |  18 +++-
 connected.c                        |   3 +
 connected.h                        |   7 ++
 ls-refs.c                          |  13 ++-
 refs.c                             |  16 +--
 refs.h                             |   5 +-
 revision.c                         | 131 +++++++++++++++--------
 revision.h                         |  43 ++++++--
 t/t6018-rev-list-glob.sh           |  40 +++++++
 t/t6021-rev-list-exclude-hidden.sh | 163 +++++++++++++++++++++++++++++
 upload-pack.c                      |  30 +++---
 15 files changed, 411 insertions(+), 83 deletions(-)
 create mode 100755 t/t6021-rev-list-exclude-hidden.sh

Range-diff against v5:

1:  cfab8ba1a2 = 1:  ef182e4330 refs: fix memory leak when parsing hideRefs config
2:  d8118c6dd8 = 2:  48913c1493 refs: get rid of global list of hidden refs
3:  93a627fb7f = 3:  3827d6a2fc revision: move together exclusion-related functions
4:  ad41ade332 = 4:  805de80e64 revision: introduce struct to handle exclusions
5:  b5a4ce432a ! 5:  d86a3342f6 revision: add new parameter to exclude hidden refs
    @@ t/t6021-rev-list-exclude-hidden.sh (new)
     +. ./test-lib.sh
     +
     +test_expect_success 'setup' '
    -+	test_commit_bulk --id=commit --ref=refs/heads/main 1 &&
    -+	COMMIT=$(git rev-parse refs/heads/main) &&
    ++	test_commit_bulk --id=commit --ref=refs/heads/branch 1 &&
    ++	COMMIT=$(git rev-parse refs/heads/branch) &&
     +	test_commit_bulk --id=tag --ref=refs/tags/lightweight 1 &&
     +	TAG=$(git rev-parse refs/tags/lightweight) &&
     +	test_commit_bulk --id=hidden --ref=refs/hidden/commit 1 &&

6: 2eeb25eef0 ! 6: f8b5eb5a7e rev-parse: add --exclude-hidden= option
@@ Commit message
rev-parse: add --exclude-hidden= option

Add a new --exclude-hidden= option that is similar to the one we just
- added to git-rev-list(1). Given a seciton name uploadpack or receive
+ added to git-rev-list(1). Given a section name uploadpack or receive
as argument, it causes us to exclude all references that would be hidden by the respective $section.hideRefs configuration.

7: f5f18f3939 = 7: a7eae80ff3 receive-pack: only use visible refs for connectivity check

Signature · 1 line
2.38.1