mbox series

[v3,0/6] receive-pack: only use visible refs for connectivity check

Message ID cover.1667823042.git.ps@pks.im (mailing list archive)
Headers show
Series receive-pack: only use visible refs for connectivity check | expand

Message

Patrick Steinhardt Nov. 7, 2022, 12:16 p.m. UTC
Hi,

this is the second 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.

In v2 of this series, we introduced a new option `--visible-refs=` that
mostly acted as if `--all` was given, but its output was restricted to
only visible refs. As Peff rightly points out though, this is less
flexible than it needs to be. This new version instead introduces a new
option `--exclude-hidden=` that can be combined with `--all`, `--glob`,
`--branches` and so on to provide a more flexible interface.

The patch series is structured as following:

    - Patch 1-3 refactor multiple different parts of refs.c and
      revision.c so that they are more readily reusable.

    - Patch 4-5 implement `--exclude-hidden=` for git-rev-list(1) and
      git-rev-parse(1).

    - Patch 6 starts using that option in the connectivity check.

Patrick


Patrick Steinhardt (6):
  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
  revparse: 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                |  12 ++-
 connected.c                        |   3 +
 connected.h                        |   7 ++
 ls-refs.c                          |  13 ++-
 refs.c                             |  14 +--
 refs.h                             |   5 +-
 revision.c                         | 118 +++++++++++++--------
 revision.h                         |  29 ++++--
 t/t6018-rev-list-glob.sh           |   8 ++
 t/t6021-rev-list-exclude-hidden.sh | 159 +++++++++++++++++++++++++++++
 upload-pack.c                      |  30 +++---
 15 files changed, 341 insertions(+), 82 deletions(-)
 create mode 100755 t/t6021-rev-list-exclude-hidden.sh

Comments

Taylor Blau Nov. 8, 2022, 12:59 a.m. UTC | #1
On Mon, Nov 07, 2022 at 01:16:19PM +0100, Patrick Steinhardt wrote:
> Patrick Steinhardt (6):
>   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
>   revparse: add `--exclude-hidden=` option
>   receive-pack: only use visible refs for connectivity check

Thanks for the updated round. This version is looking pretty good,
though it looks like Ævar and I had a few minor recommendations. I am
definitely puzzled by seeing '--exclude-hidden=transfer', though.

Thanks,
Taylor