Hi,
Attached is (what I anticipate to be) the final re-roll of my series to
introduce 'core.alternateRefsCommand' and 'core.alternateRefsPrefixes'
in order to limit the ".have" advertisement when pushing over protocol
v1 to a repository with configured alternates.
Not much has changed from last time, expect for:
- Taking a documentation suggestion from Peff (in 3/4), and
- Fixing a typo pointed out by Ramsay (in 4/4).
I believe that this series is otherwise ready for queueing, if everyone
else feels sufficiently OK about the changes.
Thanks in advance for your review.
Thanks,
Taylor
Jeff King (1):
transport: drop refnames from for_each_alternate_ref
Taylor Blau (3):
transport.c: extract 'fill_alternate_refs_command'
transport.c: introduce core.alternateRefsCommand
transport.c: introduce core.alternateRefsPrefixes
Documentation/config.txt | 18 +++++++++++++
builtin/receive-pack.c | 3 +--
fetch-pack.c | 3 +--
t/t5410-receive-pack-alternates.sh | 41 ++++++++++++++++++++++++++++++
transport.c | 38 +++++++++++++++++++++------
transport.h | 2 +-
6 files changed, 92 insertions(+), 13 deletions(-)
create mode 100755 t/t5410-receive-pack-alternates.sh
Range-diff against v4:
1: 76482a7eba = 1: e4947f557b transport: drop refnames from
for_each_alternate_ref
2: 120df009df = 2: 3d77a46c61 transport.c: extract
'fill_alternate_refs_command'
3: c63864c89a ! 3: 7451b4872a transport.c: introduce core.alternateRefsCommand
@@ -42,14 +42,9 @@
+ hex object id per line (i.e., the same as produce by `git for-each-ref
+ --format='%(objectname)'`).
++
-+This is useful when a repository only wishes to advertise some of its
-+alternate's references as `.have`'s. For example, to only advertise branch
-+heads, configure `core.alternateRefsCommand` to the path of a script
which runs
-+`git --git-dir="$1" for-each-ref --format='%(objectname)' refs/heads`.
-++
-+Note that the configured value is executed in a shell, and thus
-+linkgit:git-for-each-ref[1] by itself does not work, as scripts have to
handle
-+the path argument specially.
++Note that you cannot generally put `git for-each-ref` directly into the
config
++value, as it does not take a repository path as an argument (but you can
wrap
++the command above in a shell script).
+
core.bare::
If true this repository is assumed to be 'bare' and has no
4: 0f6cdc7ea4 ! 4: 28cbbe63f7 transport.c: introduce
core.alternateRefsPrefixes
@@ -39,8 +39,8 @@
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@
- linkgit:git-for-each-ref[1] by itself does not work, as scripts have to
handle
- the path argument specially.
+ value, as it does not take a repository path as an argument (but you can
wrap
+ the command above in a shell script).
+core.alternateRefsPrefixes::
+ When listing references from an alternate, list only references that
begin
@@ -62,7 +62,7 @@
+test_expect_success 'with core.alternateRefsPrefixes' '
+ test_config -C fork core.alternateRefsPrefixes "refs/heads/private" &&
-+ git rev-parse private/branch expect &&
++ git rev-parse private/branch >expect &&
+ printf "0000" | git receive-pack fork >actual &&
+ extract_haves <actual >actual.haves &&
+ test_cmp expect actual.haves
--
2.19.0.221.g150f307af