git/t/helper
Derrick Stolee 738e5245fa bundle-uri: parse bundle list in config format
When a bundle provider wants to operate independently from a Git remote,
they want to provide a single, consistent URI that users can use in
their 'git clone --bundle-uri' commands. At this point, the Git client
expects that URI to be a single bundle that can be unbundled and used to
bootstrap the rest of the clone from the Git server. This single bundle
cannot be re-used to assist with future incremental fetches.

To allow for the incremental fetch case, teach Git to understand a
bundle list that could be advertised at an independent bundle URI. Such
a bundle list is likely to be inspected by human readers, even if only
by the bundle provider creating the list. For this reason, we can take
our expected "key=value" pairs and instead format them using Git config
format.

Create bundle_uri_parse_config_format() to parse a file in config format
and convert that into a 'struct bundle_list' filled with its
understanding of the contents.

Be careful to use error_action CONFIG_ERROR_ERROR when calling
git_config_from_file_with_options() because the default action for
git_config_from_file() is to die() on a parsing error.  The current
warning isn't particularly helpful if it arises to a user, but it will
be made more verbose at a higher layer later.

Update 'test-tool bundle-uri' to take this config file format as input.
It uses a filename instead of stdin because there is no existing way to
parse a FILE pointer in the config machinery. Using
git_config_from_mem() is overly complicated and more likely to introduce
bugs than this simpler version.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-12 09:13:24 -07:00
..
.gitignore drop vcs-svn experiment 2020-08-13 11:02:15 -07:00
test-advise.c advice.h: add missing __attribute__((format)) & fix usage 2021-07-13 15:20:20 -07:00
test-bitmap.c t/helper/test-bitmap.c: add 'dump-hashes' mode 2021-09-14 16:34:17 -07:00
test-bloom.c test-tool bloom: fix memory leaks 2022-07-01 13:38:50 -07:00
test-bundle-uri.c bundle-uri: parse bundle list in config format 2022-10-12 09:13:24 -07:00
test-chmtime.c t/helper/test-chmtime: skip directories on Windows 2022-03-25 16:04:17 -07:00
test-config.c config: fix leaks from git_config_get_string_const() 2020-08-14 10:52:04 -07:00
test-crontab.c maintenance: add start/stop subcommands 2020-09-25 10:59:44 -07:00
test-csprng.c wrapper: add a helper to generate numbers from a CSPRNG 2022-01-17 14:17:48 -08:00
test-ctype.c
test-date.c date API: add and use a date_mode_release() 2022-02-16 09:40:00 -08:00
test-delta.c test-tool delta: fix a memory leak 2022-07-01 13:38:50 -07:00
test-dir-iterator.c
test-drop-caches.c lazyload: use correct calling conventions 2022-01-09 10:34:53 -08:00
test-dump-cache-tree.c test-tool {dump,scrap}-cache-tree: fix memory leaks 2022-07-01 13:38:49 -07:00
test-dump-fsmonitor.c
test-dump-split-index.c t/helper/test-dump-split-index: initialize git repository 2020-02-24 09:33:24 -08:00
test-dump-untracked-cache.c environment.c: remove test-specific "ignore_untracked..." variable 2021-09-22 13:15:00 -07:00
test-example-decorate.c lookup_unknown_object(): take a repository argument 2021-04-13 13:18:46 -07:00
test-fake-ssh.c
test-fast-rebase.c test-fast-rebase helper: use release_revisions() (again) 2022-08-03 10:13:50 -07:00
test-fsmonitor-client.c t/helper/fsmonitor-client: create stress test 2022-05-26 15:59:26 -07:00
test-genrandom.c
test-genzeros.c test-tool genzeros: generate large amounts of data more efficiently 2021-11-03 11:22:26 -07:00
test-getcwd.c t0001: fix broken not-quite getcwd(3) test in bed67874e2 2021-07-30 10:18:27 -07:00
test-hash-speed.c builtins + test helpers: use return instead of exit() in cmd_* 2021-06-09 09:15:58 +09:00
test-hash.c test-tool test-hash: fix a memory leak 2022-07-01 13:38:49 -07:00
test-hashmap.c Use new HASHMAP_INIT macro to simplify hashmap initialization 2020-11-11 12:55:27 -08:00
test-hexdump.c t/helper/hexdump: add helper to print hexdump of stdin 2022-05-26 15:59:27 -07:00
test-index-version.c
test-json-writer.c test-tool json-writer: fix memory leaks 2022-07-01 13:38:50 -07:00
test-lazy-init-name-hash.c
test-match-trees.c builtins + test helpers: use return instead of exit() in cmd_* 2021-06-09 09:15:58 +09:00
test-mergesort.c test-mergesort: use DEFINE_LIST_SORT 2022-07-17 15:20:38 -07:00
test-mktemp.c
test-oid-array.c tests: fix test-oid-array leak, test in SANITIZE=leak 2021-10-07 15:40:15 -07:00
test-oidmap.c
test-oidtree.c tests: fix a memory leak in test-oidtree.c 2021-10-07 15:40:15 -07:00
test-online-cpus.c
test-pack-mtimes.c t/helper: add 'pack-mtimes' test-tool 2022-05-26 15:48:26 -07:00
test-parse-options.c tests: fix a memory leak in test-parse-options.c 2021-10-07 15:40:15 -07:00
test-parse-pathspec-file.c test-parse-pathspec-file.c: s/0/NULL/ for pointer type 2020-04-27 11:21:12 -07:00
test-partial-clone.c promisor-remote: teach lazy-fetch in any repo 2021-06-28 09:58:01 -07:00
test-path-utils.c test-tool path-utils: fix a memory leak 2022-07-01 13:38:49 -07:00
test-pcre2-config.c grep/pcre2: better support invalid UTF-8 haystacks 2021-01-24 16:09:17 -08:00
test-pkt-line.c test-lib-functions: use test-tool for [de]packetize() 2021-07-19 11:53:50 -07:00
test-prio-queue.c tests: fix a memory leak in test-prio-queue.c 2021-10-07 15:40:15 -07:00
test-proc-receive.c receive-pack: use default version 0 for proc-receive 2020-11-11 12:46:56 -08:00
test-progress.c progress.c tests: make start/stop commands on stdin 2022-02-03 15:39:55 -08:00
test-reach.c builtins + test helpers: use return instead of exit() in cmd_* 2021-06-09 09:15:58 +09:00
test-read-cache.c test-read-cache: remove --table, --expand options 2021-12-22 11:42:40 -08:00
test-read-graph.c test-read-graph: include extra post-parse info 2022-03-01 12:09:55 -08:00
test-read-midx.c t/helper/test-read-midx.c: free MIDX within read_midx_file() 2021-10-27 16:26:37 -07:00
test-ref-store.c test-tool ref-store: fix a memory leak 2022-07-01 13:38:50 -07:00
test-reftable.c reftable: order unittests by complexity 2022-01-20 11:31:53 -08:00
test-regex.c test-tool regex: call regfree(), fix memory leaks 2022-07-01 13:38:50 -07:00
test-repository.c t/helper: make repository tests hash independent 2020-02-24 09:33:27 -08:00
test-revision-walking.c revisions API users: add straightforward release_revisions() 2022-04-13 23:56:08 -07:00
test-run-command.c Merge branch 'ab/hooks-regression-fix' 2022-06-13 15:53:41 -07:00
test-scrap-cache-tree.c test-tool {dump,scrap}-cache-tree: fix memory leaks 2022-07-01 13:38:49 -07:00
test-serve-v2.c serve.[ch]: remove "serve_options", split up --advertise-refs code 2021-08-05 08:59:37 -07:00
test-sha1.c
test-sha1.sh
test-sha256.c
test-sigchain.c
test-simple-ipc.c t/helper/simple-ipc: convert test-simple-ipc to use start_bg_command 2021-09-20 08:57:58 -07:00
test-strcmp-offset.c
test-string-list.c
test-submodule-config.c
test-submodule-nested-repo-config.c repository: support unabsorbed in repo_submodule_init 2021-09-09 14:09:30 -07:00
test-subprocess.c run-command API users: use strvec_pushv(), not argv assignment 2021-11-25 22:15:07 -08:00
test-tool.c bundle-uri: unit test "key=value" parsing 2022-10-12 09:13:24 -07:00
test-tool.h bundle-uri: unit test "key=value" parsing 2022-10-12 09:13:24 -07:00
test-trace2.c bug_fl(): correctly initialize trace2 va_list 2022-06-16 13:28:22 -07:00
test-urlmatch-normalization.c test-tool urlmatch-normalization: fix a memory leak 2022-07-01 13:38:49 -07:00
test-userdiff.c userdiff tests: list builtin drivers via test-tool 2021-04-08 12:19:10 -07:00
test-wildmatch.c
test-windows-named-pipe.c
test-write-cache.c
test-xml-encode.c