From: Jonathan Tan <hidden> Date: 2020-08-14 19:32:41
When fetching with packfile URIs and transfer.fsckobjects=1, use the
--fsck-objects instead of the --strict flag when invoking index-pack so
that links are not checked, only objects. This is because incomplete
links are expected. (A subsequent connectivity check will be done when
all the packs have been downloaded regardless of whether
transfer.fsckobjects is set.)
This is similar to 98a2ea46c2 ("fetch-pack: do not check links for
partial fetch", 2018-03-15), but for packfile URIs instead of partial
clones.
Signed-off-by: Jonathan Tan <redacted>
---
The subject is longer than 50 characters but I couldn't find a way to
shorten it, especially since I think it's important to mention packfile
URIs and transfer.fsckobjects. Any suggestions appreciated.
---
fetch-pack.c | 2 +-
t/t5702-protocol-v2.sh | 53 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 1 deletion(-)
@@ -883,6 +883,59 @@ test_expect_success 'fetching with valid packfile URI but invalid hash fails' 'test_i18ngrep"pack downloaded from.*does not match expected hash"err'+test_expect_success'packfile-uri with transfer.fsckobjects''+P="$HTTPD_DOCUMENT_ROOT_PATH/http_parent"&&+rm-rf"$P"http_childlog&&++gitinit"$P"&&+git-C"$P"config"uploadpack.allowsidebandall""true"&&++echomy-blob>"$P/my-blob"&&+git-C"$P"addmy-blob&&+git-C"$P"commit-mx&&++configure_exclusion"$P"my-blob>h&&++sane_unsetGIT_TEST_SIDEBAND_ALL&&+git-cprotocol.version=2-ctransfer.fsckobjects=1\+-cfetch.uriprotocols=http,https\+clone"$HTTPD_URL/smart/http_parent"http_child&&++# Ensure that there are exactly 4 files (2 .pack and 2 .idx).+lshttp_child/.git/objects/pack/*>filelist&&+test_line_count=4filelist+'++test_expect_success'packfile-uri with transfer.fsckobjects fails on bad object''+P="$HTTPD_DOCUMENT_ROOT_PATH/http_parent"&&+rm-rf"$P"http_childlog&&++gitinit"$P"&&+git-C"$P"config"uploadpack.allowsidebandall""true"&&++cat>bogus-commit<<EOF&&+tree$EMPTY_TREE+authorBugsBunny1234567890+0000+committerBugsBunny<bugs@bun.ni>1234567890+0000++Thiscommitobjectintentionallybroken+EOF+BOGUS=$(git-C"$P"hash-object-tcommit-w--stdin<bogus-commit)&&+git-C"$P"branchbogus-branch"$BOGUS"&&++echomy-blob>"$P/my-blob"&&+git-C"$P"addmy-blob&&+git-C"$P"commit-mx&&++configure_exclusion"$P"my-blob>h&&++sane_unsetGIT_TEST_SIDEBAND_ALL&&+test_must_failgit-cprotocol.version=2-ctransfer.fsckobjects=1\+-cfetch.uriprotocols=http,https\+clone"$HTTPD_URL/smart/http_parent"http_child2>error&&+test_i18ngrep"invalid author/committer line - missing email"error+'+# DO NOT add non-httpd-specific tests here, because the last part of this# test script is only executed when httpd is available and enabled.
From: Jonathan Tan <hidden> Date: 2020-08-17 19:49:07
When fetching with packfile URIs and transfer.fsckobjects=1, use the
--fsck-objects instead of the --strict flag when invoking index-pack so
that links are not checked, only objects. This is because incomplete
links are expected. (A subsequent connectivity check will be done when
all the packs have been downloaded regardless of whether
transfer.fsckobjects is set.)
This is similar to 98a2ea46c2 ("fetch-pack: do not check links for
partial fetch", 2018-03-15), but for packfile URIs instead of partial
clones.
Signed-off-by: Jonathan Tan <redacted>
---
The subject is longer than 50 characters but I couldn't find a way to
shorten it, especially since I think it's important to mention packfile
URIs and transfer.fsckobjects. Any suggestions appreciated.
---
fetch-pack.c | 2 +-
t/t5702-protocol-v2.sh | 53 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 1 deletion(-)
@@ -883,6 +883,59 @@ test_expect_success 'fetching with valid packfile URI but invalid hash fails' 'test_i18ngrep"pack downloaded from.*does not match expected hash"err'+test_expect_success'packfile-uri with transfer.fsckobjects''+P="$HTTPD_DOCUMENT_ROOT_PATH/http_parent"&&+rm-rf"$P"http_childlog&&++gitinit"$P"&&+git-C"$P"config"uploadpack.allowsidebandall""true"&&++echomy-blob>"$P/my-blob"&&+git-C"$P"addmy-blob&&+git-C"$P"commit-mx&&++configure_exclusion"$P"my-blob>h&&++sane_unsetGIT_TEST_SIDEBAND_ALL&&+git-cprotocol.version=2-ctransfer.fsckobjects=1\+-cfetch.uriprotocols=http,https\+clone"$HTTPD_URL/smart/http_parent"http_child&&++# Ensure that there are exactly 4 files (2 .pack and 2 .idx).+lshttp_child/.git/objects/pack/*>filelist&&+test_line_count=4filelist+'++test_expect_success'packfile-uri with transfer.fsckobjects fails on bad object''+P="$HTTPD_DOCUMENT_ROOT_PATH/http_parent"&&+rm-rf"$P"http_childlog&&++gitinit"$P"&&+git-C"$P"config"uploadpack.allowsidebandall""true"&&++cat>bogus-commit<<EOF&&+tree$EMPTY_TREE+authorBugsBunny1234567890+0000+committerBugsBunny<bugs@bun.ni>1234567890+0000++Thiscommitobjectintentionallybroken+EOF+BOGUS=$(git-C"$P"hash-object-tcommit-w--stdin<bogus-commit)&&+git-C"$P"branchbogus-branch"$BOGUS"&&++echomy-blob>"$P/my-blob"&&+git-C"$P"addmy-blob&&+git-C"$P"commit-mx&&++configure_exclusion"$P"my-blob>h&&++sane_unsetGIT_TEST_SIDEBAND_ALL&&+test_must_failgit-cprotocol.version=2-ctransfer.fsckobjects=1\+-cfetch.uriprotocols=http,https\+clone"$HTTPD_URL/smart/http_parent"http_child2>error&&+test_i18ngrep"invalid author/committer line - missing email"error+'+# DO NOT add non-httpd-specific tests here, because the last part of this# test script is only executed when httpd is available and enabled.
From: Jonathan Tan <hidden> Date: 2020-08-17 19:49:13
dd4b732df7 ("upload-pack: send part of packfile response as uri",
2020-06-10) added the "only_packfile" parameter to get_pack() but did
not document it. Add documentation.
Signed-off-by: Jonathan Tan <redacted>
---
fetch-pack.c | 4 ++++
1 file changed, 4 insertions(+)
From: Jonathan Tan <hidden> Date: 2020-08-17 19:49:15
88e2f9ed8e ("introduce fetch-object: fetch one promisor object",
2017-12-05) plumbed through the from_promisor parameter but did
not document it everywhere it appeared. Add the documentation.
(It also plumbed through the no_dependents parameter, but I have left
that alone because it is being removed in a commit under review [1].)
[1] https://lore.kernel.org/git/e8f16d69089a5011c355d5939c56fa53b7a1eb2d.1597184949.git.jonathantanmy@google.com/
Signed-off-by: Jonathan Tan <redacted>
---
fetch-pack.h | 8 ++++++++
remote-curl.c | 3 +++
transport.h | 3 +++
3 files changed, 14 insertions(+)
@@ -39,7 +39,10 @@ struct options {/* One of the SEND_PACK_PUSH_CERT_* constants. */push_cert:2,deepen_relative:1,++/* see documentation of corresponding flag in fetch-pack.h */from_promisor:1,+no_dependents:1,atomic:1,object_format:1;
@@ -15,7 +15,10 @@ struct git_transport_options {unsignedself_contained_and_connected:1;unsignedupdate_shallow:1;unsigneddeepen_relative:1;++/* see documentation of corresponding flag in fetch-pack.h */unsignedfrom_promisor:1;+unsignedno_dependents:1;/*
From: Jonathan Tan <hidden> Date: 2020-08-17 19:49:17
Thanks, Junio, for taking a look.
Differences from v1:
- Added 2 patches that document parts that Junio mentioned were
underdocumented [1]. I'm not sure about only_packfile, since it's
narrowly scoped (just an argument in a static function) but I've
included it anyway.
- Used <<-EOF instead of <<EOF.
[1] https://lore.kernel.org/git/xmqq8sehvw13.fsf@gitster.c.googlers.com/
Jonathan Tan (3):
(various): document from_promisor parameter
fetch-pack: document only_packfile in get_pack()
fetch-pack: make packfile URIs work with transfer.fsckobjects
fetch-pack.c | 6 ++++-
fetch-pack.h | 8 +++++++
remote-curl.c | 3 +++
t/t5702-protocol-v2.sh | 53 ++++++++++++++++++++++++++++++++++++++++++
transport.h | 3 +++
5 files changed, 72 insertions(+), 1 deletion(-)
--
2.28.0.220.ged08abb693-goog