{"thread":{"id":"66785","subject":"[PATCH v3 0/3] bundle-uri: do not die on unresolvable relative URIs","startedAt":"2026-11-05T15:28:39Z","lastAt":"2026-11-09T10:56:53Z","messageCount":13,"participants":["Aniket Gupta","Derrick Stolee","Junio C Hamano","Patrick Steinhardt"],"isPatch":true,"patchVersion":3,"patchTotal":3},"messages":[{"id":"557568","messageId":"20261105152842.566318-1-aniketgupta3001@gmail.com","threadId":"66785","inReplyTo":null,"subject":"[PATCH v3 0/3] bundle-uri: do not die on unresolvable relative URIs","fromName":"Aniket Gupta","fromEmail":"aniketgupta3001@gmail.com","sentAt":"2026-11-05T15:28:39Z","receivedAt":"2026-11-05T15:28:39Z","isPatch":true,"sender":{"key":"aniketgupta3001@gmail.com","avatar":null},"body":"A bundle list can contain a relative URI that cannot be resolved, and\ntoday one such entry makes the whole clone die. This series lets the\nbundle code report it and skip that bundle instead.\n\nChanges since v2:\n- split into three patches\n- reworded the commit message to describe relative_url() as a thin\n  wrapper around relative_url_gently()\n- the credentials test now compares the full error message\n- the error names the URL that was passed in, not what is left of it\n  after some components were stripped off\n\nAniket Gupta (3):\n  remote: add relative_url_gently()\n  remote: do not show credentials when relative_url() fails\n  bundle-uri: do not die on unresolvable relative URIs\n\n bundle-uri.c                | 10 +++++++++-\n remote.c                    | 37 +++++++++++++++++++++++++++++++------\n remote.h                    |  8 ++++++++\n t/t0060-path-utils.sh       |  9 +++++++++\n t/t5750-bundle-uri-parse.sh | 15 +++++++--------\n 5 files changed, 64 insertions(+), 15 deletions(-)\n\n\nbase-commit: ebdc087dc99d68bb340c282b2ba5f722def28d19\n-- \n2.43.0\n\n\n"},{"id":"557569","messageId":"20261105152842.566318-2-aniketgupta3001@gmail.com","threadId":"66785","inReplyTo":"20261105152842.566318-1-aniketgupta3001@gmail.com","subject":"[PATCH v3 1/3] remote: add relative_url_gently()","fromName":"Aniket Gupta","fromEmail":"aniketgupta3001@gmail.com","sentAt":"2026-11-05T15:28:40Z","receivedAt":"2026-11-05T15:28:40Z","isPatch":true,"sender":{"key":"aniketgupta3001@gmail.com","avatar":null},"body":"relative_url() calls die() when there are more \"../\" components in the\nURL than the base URL can absorb. A caller that would rather carry on\nhas no way to do so.\n\nAdd relative_url_gently(), which returns NULL and adds the reason to a\nstrbuf instead of dying. relative_url() is now a thin wrapper around\nit that continues to die, so existing callers behave the same.\n\nSigned-off-by: Aniket Gupta <aniketgupta3001@gmail.com>\n---\n remote.c | 34 ++++++++++++++++++++++++++++------\n remote.h |  8 ++++++++\n 2 files changed, 36 insertions(+), 6 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex 49ee2ea318..899d805b76 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -3005,7 +3005,8 @@ void remote_state_clear(struct remote_state *remote_state)\n }\n \n /*\n- * Returns 1 if it was the last chop before ':'.\n+ * Returns 1 if it was the last chop before ':', or -1 if there is\n+ * nothing left to chop.\n  */\n static int chop_last_dir(char **remoteurl, int is_relative)\n {\n@@ -3022,16 +3023,15 @@ static int chop_last_dir(char **remoteurl, int is_relative)\n \t}\n \n \tif (is_relative || !strcmp(\".\", *remoteurl))\n-\t\tdie(_(\"cannot strip one component off url '%s'\"),\n-\t\t\t*remoteurl);\n+\t\treturn -1;\n \n \tfree(*remoteurl);\n \t*remoteurl = xstrdup(\".\");\n \treturn 0;\n }\n \n-char *relative_url(const char *remote_url, const char *url,\n-\t\t   const char *up_path)\n+char *relative_url_gently(const char *remote_url, const char *url,\n+\t\t\t  const char *up_path, struct strbuf *err)\n {\n \tint is_relative = 0;\n \tint colonsep = 0;\n@@ -3073,8 +3073,19 @@ char *relative_url(const char *remote_url, const char *url,\n \t */\n \twhile (*url) {\n \t\tif (starts_with_dot_dot_slash_native(url)) {\n+\t\t\tint chopped;\n+\n \t\t\turl += 3;\n-\t\t\tcolonsep |= chop_last_dir(&remoteurl, is_relative);\n+\t\t\tchopped = chop_last_dir(&remoteurl, is_relative);\n+\t\t\tif (chopped < 0) {\n+\t\t\t\tstrbuf_addf(err,\n+\t\t\t\t\t    _(\"cannot strip one component off url '%s'\"),\n+\t\t\t\t\t    remoteurl);\n+\t\t\t\tfree(remoteurl);\n+\t\t\t\tstrbuf_release(&sb);\n+\t\t\t\treturn NULL;\n+\t\t\t}\n+\t\t\tcolonsep |= chopped;\n \t\t} else if (starts_with_dot_slash_native(url))\n \t\t\turl += 2;\n \t\telse\n@@ -3102,6 +3113,17 @@ char *relative_url(const char *remote_url, const char *url,\n \treturn strbuf_detach(&sb, NULL);\n }\n \n+char *relative_url(const char *remote_url, const char *url,\n+\t\t   const char *up_path)\n+{\n+\tstruct strbuf err = STRBUF_INIT;\n+\tchar *out = relative_url_gently(remote_url, url, up_path, &err);\n+\n+\tif (!out)\n+\t\tdie(\"%s\", err.buf);\n+\treturn out;\n+}\n+\n int valid_remote_name(const char *name)\n {\n \tint result;\ndiff --git a/remote.h b/remote.h\nindex cca02033b9..940474fa71 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -478,6 +478,14 @@ void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *);\n char *relative_url(const char *remote_url, const char *url,\n \t\t   const char *up_path);\n \n+/*\n+ * Like relative_url(), but if `url` cannot be resolved against\n+ * `remote_url`, return NULL and add the reason to `err` instead of\n+ * dying. `err` must not be NULL.\n+ */\n+char *relative_url_gently(const char *remote_url, const char *url,\n+\t\t\t  const char *up_path, struct strbuf *err);\n+\n int valid_remote_name(const char *name);\n \n #endif\n-- \n2.43.0\n\n\n"},{"id":"557570","messageId":"20261105152842.566318-3-aniketgupta3001@gmail.com","threadId":"66785","inReplyTo":"20261105152842.566318-1-aniketgupta3001@gmail.com","subject":"[PATCH v3 2/3] remote: do not show credentials when relative_url() fails","fromName":"Aniket Gupta","fromEmail":"aniketgupta3001@gmail.com","sentAt":"2026-11-05T15:28:41Z","receivedAt":"2026-11-05T15:28:41Z","isPatch":true,"sender":{"key":"aniketgupta3001@gmail.com","avatar":null},"body":"When relative_url() cannot resolve a URL, it names the URL in its error\nmessage. If the URL contains a user name and password, both end up in\nthe message, and from there in terminal output and logs.\n\nPass the URL through transport_anonymize_url() first. Also name the\nURL that was passed in rather than what is left of it after some\ncomponents have already been stripped off, which is what a user would\nrecognize.\n\nSigned-off-by: Aniket Gupta <aniketgupta3001@gmail.com>\n---\n remote.c              | 5 ++++-\n t/t0060-path-utils.sh | 9 +++++++++\n 2 files changed, 13 insertions(+), 1 deletion(-)\n\ndiff --git a/remote.c b/remote.c\nindex 899d805b76..36834b129c 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -3078,9 +3078,12 @@ char *relative_url_gently(const char *remote_url, const char *url,\n \t\t\turl += 3;\n \t\t\tchopped = chop_last_dir(&remoteurl, is_relative);\n \t\t\tif (chopped < 0) {\n+\t\t\t\tchar *anon = transport_anonymize_url(remote_url);\n+\n \t\t\t\tstrbuf_addf(err,\n \t\t\t\t\t    _(\"cannot strip one component off url '%s'\"),\n-\t\t\t\t\t    remoteurl);\n+\t\t\t\t\t    anon);\n+\t\t\t\tfree(anon);\n \t\t\t\tfree(remoteurl);\n \t\t\t\tstrbuf_release(&sb);\n \t\t\t\treturn NULL;\ndiff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh\nindex 56faf5fe73..cea0d13429 100755\n--- a/t/t0060-path-utils.sh\n+++ b/t/t0060-path-utils.sh\n@@ -394,6 +394,15 @@ test_submodule_relative_url \"../\" \"$(pwd)/addtest\" \"../repo\" \"$(pwd)/repo\"\n test_submodule_relative_url \"../\" \"foo/bar\" \"../submodule\" \"../foo/submodule\"\n test_submodule_relative_url \"../\" \"foo\" \"../submodule\" \"../submodule\"\n \n+test_expect_success 'relative_url() does not show credentials when it fails' '\n+\tcat >expect <<-\\EOF &&\n+\tfatal: cannot strip one component off url '\\''https://host.example/a'\\''\n+\tEOF\n+\ttest_must_fail test-tool submodule resolve-relative-url \"\" \\\n+\t\t\"https://user:secret@host.example/a\" ../../../../../../x 2>actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_submodule_relative_url \"(null)\" \"../foo/bar\" \"../sub/a/b/c\" \"../foo/sub/a/b/c\"\n test_submodule_relative_url \"(null)\" \"../foo/bar\" \"../sub/a/b/c/\" \"../foo/sub/a/b/c\"\n test_submodule_relative_url \"(null)\" \"../foo/bar/\" \"../sub/a/b/c\" \"../foo/sub/a/b/c\"\n-- \n2.43.0\n\n\n"},{"id":"557571","messageId":"20261105152842.566318-4-aniketgupta3001@gmail.com","threadId":"66785","inReplyTo":"20261105152842.566318-1-aniketgupta3001@gmail.com","subject":"[PATCH v3 3/3] bundle-uri: do not die on unresolvable relative URIs","fromName":"Aniket Gupta","fromEmail":"aniketgupta3001@gmail.com","sentAt":"2026-11-05T15:28:42Z","receivedAt":"2026-11-05T15:28:42Z","isPatch":true,"sender":{"key":"aniketgupta3001@gmail.com","avatar":null},"body":"A bundle list, either advertised by a server or given to \"git clone\n--bundle-uri\", may contain relative URIs. They are resolved with\nrelative_url(), which calls die() when there are more \"../\" components\nthan the base can absorb, so one bad entry aborts the whole clone.\n\nResolve them with relative_url_gently() instead. When that fails,\nbundle_list_update() reports the problem as an error and leaves the\nbundle without a URI. The download code already skips such a bundle,\nso the clone carries on with the others.\n\nThis resolves the TODO in t5750, so update the test to match.\n\nSigned-off-by: Aniket Gupta <aniketgupta3001@gmail.com>\n---\n bundle-uri.c                | 10 +++++++++-\n t/t5750-bundle-uri-parse.sh | 15 +++++++--------\n 2 files changed, 16 insertions(+), 9 deletions(-)\n\ndiff --git a/bundle-uri.c b/bundle-uri.c\nindex 2bb2eb99e4..1f198ef9a9 100644\n--- a/bundle-uri.c\n+++ b/bundle-uri.c\n@@ -210,9 +210,17 @@ static int bundle_list_update(const char *key, const char *value,\n \tstrbuf_release(&id);\n \n \tif (!strcmp(subkey, \"uri\")) {\n+\t\tstruct strbuf err = STRBUF_INIT;\n+\n \t\tif (bundle->uri)\n \t\t\treturn -1;\n-\t\tbundle->uri = relative_url(list->baseURI, value, NULL);\n+\t\tbundle->uri = relative_url_gently(list->baseURI, value, NULL,\n+\t\t\t\t\t\t  &err);\n+\t\tif (!bundle->uri) {\n+\t\t\terror(\"%s\", err.buf);\n+\t\t\tstrbuf_release(&err);\n+\t\t\treturn -1;\n+\t\t}\n \t\treturn 0;\n \t}\n \ndiff --git a/t/t5750-bundle-uri-parse.sh b/t/t5750-bundle-uri-parse.sh\nindex 70ae94c4d0..8abf8f31ae 100755\n--- a/t/t5750-bundle-uri-parse.sh\n+++ b/t/t5750-bundle-uri-parse.sh\n@@ -68,17 +68,16 @@ test_expect_success 'bundle_uri_parse_line(): relative URIs and parent paths' '\n \t\turi = <uri>/bundle.bdl\n \t[bundle \"two\"]\n \t\turi = bundle.bdl\n-\t[bundle \"three\"]\n-\t\turi = <uri>/../bundle.bdl\n \tEOF\n \n-\t# TODO: We would prefer if parsing a bundle list would not cause\n-\t# a die() and instead would give a warning and allow the rest of\n-\t# a Git command to continue. This test_must_fail is necessary for\n-\t# now until the interface for relative_url() allows for reporting\n-\t# an error instead of die()ing.\n+\tcat >err.expect <<-\\EOF &&\n+\terror: cannot strip one component off url '\\''<uri>'\\''\n+\terror: bad line: '\\''bundle.three.uri=../../bundle.bdl'\\''\n+\tEOF\n+\n \ttest_must_fail test-tool bundle-uri parse-key-values in >actual 2>err &&\n-\ttest_grep \"fatal: cannot strip one component off url\" err\n+\ttest_cmp err.expect err &&\n+\ttest_cmp_config_output expect actual\n '\n \n test_expect_success 'bundle_uri_parse_line() parsing edge cases: empty key or value' '\n-- \n2.43.0\n\n\n"},{"id":"557687","messageId":"aa2063a2-3fab-453c-9f88-86861432eede@gmail.com","threadId":"66785","inReplyTo":"20261105152842.566318-2-aniketgupta3001@gmail.com","subject":"Re: [PATCH v3 1/3] remote: add relative_url_gently()","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2026-11-06T14:36:37Z","receivedAt":"2026-11-06T14:36:37Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 11/5/2026 10:28 AM, Aniket Gupta wrote:\n> relative_url() calls die() when there are more \"../\" components in the\n> URL than the base URL can absorb. A caller that would rather carry on\n> has no way to do so.\n\nI agree that we should have a mechanism to allow users to know about a\nbroken bundle URI and to respond somehow. \n> Add relative_url_gently(), which returns NULL and adds the reason to a\n> strbuf instead of dying. relative_url() is now a thin wrapper around\n> it that continues to die, so existing callers behave the same.\n\nThis method is good to have, in general, and is written well.\n\nThe only question here is if we should be changing the behavior for\nbundle-URI clones from halting on bad data to skipping bundles and\ndoing the full operation from the remote.\n\n(But there's more about this in patch 3, so I'll defer until then.)\n\nThanks,\n-Stolee\n\n\n"},{"id":"557688","messageId":"85924f20-298f-401e-88f7-7fb3f949d0fe@gmail.com","threadId":"66785","inReplyTo":"20261105152842.566318-3-aniketgupta3001@gmail.com","subject":"Re: [PATCH v3 2/3] remote: do not show credentials when relative_url() fails","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2026-11-06T14:43:50Z","receivedAt":"2026-11-06T14:43:50Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 11/5/2026 10:28 AM, Aniket Gupta wrote:\n> When relative_url() cannot resolve a URL, it names the URL in its error\n> message. If the URL contains a user name and password, both end up in\n> the message, and from there in terminal output and logs.\n> \n> Pass the URL through transport_anonymize_url() first. Also name the\n> URL that was passed in rather than what is left of it after some\n> components have already been stripped off, which is what a user would\n> recognize.\n\nI'm less convinced on this factor. I understand anonymizing the URL if\nwe are sending it to a location that is perhaps \"less trusted\" (like\ntrace logs) but the user asked us to operate on a given URL that caused\nproblems, so they should know the string that caused problems.\n\nIn environments that store stdout/stderr logs, those systems already\nneed to be careful about such strings in the commands themselves, let\nalone the output strings.\n\nAnd back to the bundle-URI application: if the bundle list uses such\nURIs for its child bundles, then that's not a safe mechanism for\ncommunicating those credentials. This isn't going to protect secrets\nlike that from being exposed.\n\nThis is just my opinion on the necessity of this change. If we _do_\nwant this change, then I continued my review: the patch accomplishes\nits goal.\n> @@ -3078,9 +3078,12 @@ char *relative_url_gently(const char *remote_url, const char *url,\n>  \t\t\turl += 3;\n>  \t\t\tchopped = chop_last_dir(&remoteurl, is_relative);\n>  \t\t\tif (chopped < 0) {\n> +\t\t\t\tchar *anon = transport_anonymize_url(remote_url);\n> +\n>  \t\t\t\tstrbuf_addf(err,\n>  \t\t\t\t\t    _(\"cannot strip one component off url '%s'\"),\n> -\t\t\t\t\t    remoteurl);\n> +\t\t\t\t\t    anon);\n> +\t\t\t\tfree(anon);\n>  \t\t\t\tfree(remoteurl);\n\nThis code looks good, assuming taht we want to make this change.\n\n> +test_expect_success 'relative_url() does not show credentials when it fails' '\n> +\tcat >expect <<-\\EOF &&\n> +\tfatal: cannot strip one component off url '\\''https://host.example/a'\\''\n> +\tEOF\n> +\ttest_must_fail test-tool submodule resolve-relative-url \"\" \\\n> +\t\t\"https://user:secret@host.example/a\" ../../../../../../x 2>actual &&\n> +\ttest_cmp expect actual\n> +'\nThank you for including a test that demonstrates this change.\n\nThanks,\n-Stolee\n\n\n"},{"id":"557690","messageId":"0ad84940-b107-4015-849b-f91f1e4ac1d3@gmail.com","threadId":"66785","inReplyTo":"20261105152842.566318-4-aniketgupta3001@gmail.com","subject":"Re: [PATCH v3 3/3] bundle-uri: do not die on unresolvable relative URIs","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2026-11-06T14:51:25Z","receivedAt":"2026-11-06T14:51:25Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 11/5/2026 10:28 AM, Aniket Gupta wrote:\n> A bundle list, either advertised by a server or given to \"git clone\n> --bundle-uri\", may contain relative URIs. They are resolved with\n> relative_url(), which calls die() when there are more \"../\" components\n> than the base can absorb, so one bad entry aborts the whole clone.\n> \n> Resolve them with relative_url_gently() instead. When that fails,\n> bundle_list_update() reports the problem as an error and leaves the\n> bundle without a URI. The download code already skips such a bundle,\n> so the clone carries on with the others.\n> \n> This resolves the TODO in t5750, so update the test to match.\n\nThis TODO was added in ebc39479558 (bundle-uri: allow relative URLs\nin bundle lists, 2022-12-22) by _me_, so clearly I thought that this\nwas a good change at the time. I should retract my concerns about\nthe change from patch 1.\n\nThe only thing that is different now is that the feature has existed\nfor a while, so maybe some depend on this behavior that we're\nchanging. That's unlikely to be important.\n\nSo I'll officially say: thanks for contributing this cleanup!\n\n> @@ -210,9 +210,17 @@ static int bundle_list_update(const char *key, const char *value,\n>  \tstrbuf_release(&id);\n>  \n>  \tif (!strcmp(subkey, \"uri\")) {\n> +\t\tstruct strbuf err = STRBUF_INIT;\n> +\n>  \t\tif (bundle->uri)\n>  \t\t\treturn -1;\n> -\t\tbundle->uri = relative_url(list->baseURI, value, NULL);\n> +\t\tbundle->uri = relative_url_gently(list->baseURI, value, NULL,\n> +\t\t\t\t\t\t  &err);\n> +\t\tif (!bundle->uri) {\n> +\t\t\terror(\"%s\", err.buf);\n> +\t\t\tstrbuf_release(&err);\n> +\t\t\treturn -1;\n> +\t\t}\n>  \t\treturn 0;\n>  \t}\n>  \n> diff --git a/t/t5750-bundle-uri-parse.sh b/t/t5750-bundle-uri-parse.sh\n> index 70ae94c4d0..8abf8f31ae 100755\n> --- a/t/t5750-bundle-uri-parse.sh\n> +++ b/t/t5750-bundle-uri-parse.sh\n> @@ -68,17 +68,16 @@ test_expect_success 'bundle_uri_parse_line(): relative URIs and parent paths' '\n>  \t\turi = <uri>/bundle.bdl\n>  \t[bundle \"two\"]\n>  \t\turi = bundle.bdl\n> -\t[bundle \"three\"]\n> -\t\turi = <uri>/../bundle.bdl\n>  \tEOF\n\nIn the context of this diff, this looks like you are removing the\nbad input, but this is actually the expected output of the test-tool.\n\nThe input is a few lines earlier:\n\n\tcat >in <<-\\EOF &&\n\tbundle.one.uri=bundle.bdl\n\tbundle.two.uri=../bundle.bdl\n\tbundle.three.uri=../../bundle.bdl\n\tEOF\n\n>  \n> -\t# TODO: We would prefer if parsing a bundle list would not cause\n> -\t# a die() and instead would give a warning and allow the rest of\n> -\t# a Git command to continue. This test_must_fail is necessary for\n> -\t# now until the interface for relative_url() allows for reporting\n> -\t# an error instead of die()ing.\n> +\tcat >err.expect <<-\\EOF &&\n> +\terror: cannot strip one component off url '\\''<uri>'\\''\n> +\terror: bad line: '\\''bundle.three.uri=../../bundle.bdl'\\''\n> +\tEOF\n> +\n\nBut this err.expect matches.\n\n>  \ttest_must_fail test-tool bundle-uri parse-key-values in >actual 2>err &&\n> -\ttest_grep \"fatal: cannot strip one component off url\" err\n> +\ttest_cmp err.expect err &&\n> +\ttest_cmp_config_output expect actual\n\nAnd now we're actually seeing the list match the expectation (minus\nthe broken item).\n\nLGTM.\nThanks,\n-Stolee\n\n\n"},{"id":"557692","messageId":"25a32212-4906-467b-9b1b-301b38ca0e2d@gmail.com","threadId":"66785","inReplyTo":"20261105152842.566318-1-aniketgupta3001@gmail.com","subject":"Re: [PATCH v3 0/3] bundle-uri: do not die on unresolvable relative URIs","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2026-11-06T14:57:41Z","receivedAt":"2026-11-06T14:57:41Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 11/5/2026 10:28 AM, Aniket Gupta wrote:\n> A bundle list can contain a relative URI that cannot be resolved, and\n> today one such entry makes the whole clone die. This series lets the\n> bundle code report it and skip that bundle instead.\n\nWhen reading patch-by-patch, I initially was concerned about the\nbehavior change. However, patch 3 removes a long-standing TODO\ncomment _that I wrote_ so I'm inclined to take the change. I\ndidn't see anything critical to change about these patches.\n\nThat said, we may have something for #leftoverbits:\n\nHow could we create a toggle to re-enable the die() if desired?\n\nPerhaps a user _wants_ to fail on bad URIs instead of spending\ntime on an incomplete bundle advertisement and expensive fetch\nfrom the remote.\n\nSuch an option could be a follow-up, now that you've implemented\nthe _gently() version and the bundle URI machinery could decide\nfor itself whether this is a hard failure or not.\n\nThanks,\n-Stolee\n\n\n"},{"id":"557716","messageId":"20261106172533.612673-1-aniketgupta3001@gmail.com","threadId":"66785","inReplyTo":"25a32212-4906-467b-9b1b-301b38ca0e2d@gmail.com","subject":"Re: [PATCH v3 0/3] bundle-uri: do not die on unresolvable relative URIs","fromName":"Aniket Gupta","fromEmail":"aniketgupta3001@gmail.com","sentAt":"2026-11-06T17:25:33Z","receivedAt":"2026-11-06T17:25:33Z","isPatch":true,"sender":{"key":"aniketgupta3001@gmail.com","avatar":null},"body":"Hi Stolee,\n\nThanks for the review.\n\n> I'm less convinced on this factor.\n\nFair point. I tried it with a password in the remote URL but the \"failed\nto download bundle from URI\" warning prints it as is. I think this patch\nwill only cover this one message. The reason I did it is that git\nalready hides the password when it shows a remote URL. For eg. in the\n\"From\" line of fetch. It is a separate patch so it is easy to drop if\nyou and Patrick think it is not worth it.\n\nWhile checking this I noticed that my commit message for patch 3 is not\naccurate. It says that the clone carries on with the other bundles, but\nthe list is only used up to the bad entry (not at all for a list given\nto --bundle-uri) and then the clone fetches from the remote. I can send\na v4 with that fixed if its fine\n\nAniket\n\n"},{"id":"557728","messageId":"xmqqqzgxixes.fsf@gitster.g","threadId":"66785","inReplyTo":"85924f20-298f-401e-88f7-7fb3f949d0fe@gmail.com","subject":"Re: [PATCH v3 2/3] remote: do not show credentials when relative_url() fails","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-06T19:15:39Z","receivedAt":"2026-11-06T19:15:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Derrick Stolee <stolee@gmail.com> writes:\n\n> In environments that store stdout/stderr logs, those systems already\n> need to be careful about such strings in the commands themselves, let\n> alone the output strings.\n\nHmph, is this true?  How can these systems be _careful_ without\nknowing what these strings are?  By guessing that https:// is a common\nenough thing that shoud raise red flag if there is some:thing@ that\nfollows it?\n\n> And back to the bundle-URI application: if the bundle list uses such\n> URIs for its child bundles, then that's not a safe mechanism for\n> communicating those credentials. This isn't going to protect secrets\n> like that from being exposed.\n\nThis is very true.  So the patch may be protecting us against an\nissue that does not exist in practice?\n\nWhere do we use anonymize_url() in existing code paths?\n\n - \"git clone\" leaving \"clone: from X\" in the reflog\n - \"git fetch\" showing \"From X\" to show ref updates\n - \"git push\" shwoing \"Pushing to X\" in verbose output\n - remote-curl talking about \"url\" in die() messages\n - transport showing \"To X\" to show push_report.\n\nThese are all talking about what is shown on the screen except for\nthe reflog entry left by \"git clone\", I think.\n\nThanks.\n\n\n\n"},{"id":"557903","messageId":"avGR422rPHr1Orv5@pks.im","threadId":"66785","inReplyTo":"20261106172533.612673-1-aniketgupta3001@gmail.com","subject":"Re: [PATCH v3 0/3] bundle-uri: do not die on unresolvable relative URIs","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-11-09T09:26:59Z","receivedAt":"2026-11-09T09:26:59Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Nov 06, 2026 at 05:25:33PM +0000, Aniket Gupta wrote:\n> Hi Stolee,\n> \n> Thanks for the review.\n> \n> > I'm less convinced on this factor.\n\nHuh, where does this quote come from? It's certainly not part of the\nmail you reply to. Also, you stripped all necessary context for somebody\nto know what this was even talking about.\n\n> Fair point. I tried it with a password in the remote URL but the \"failed\n> to download bundle from URI\" warning prints it as is. I think this patch\n> will only cover this one message. The reason I did it is that git\n> already hides the password when it shows a remote URL. For eg. in the\n> \"From\" line of fetch. It is a separate patch so it is easy to drop if\n> you and Patrick think it is not worth it.\n\nI don't have a strong opinion on whether or not we should strip\ncredentials. It feels like the right thing to do, but I trust Stolee's\ninput here.\n\nBut the other part of patch 2 should definitely be retained in my\nopinion, because printing an error with the URL after we have trimmed\n\"../\" components off of it is just plain not useful. There is no way for\nthe user to tell how the URL is broken because we may have already\nstripped the relevant components here.\n\nPatrick\n\n"},{"id":"557919","messageId":"20261109103916.397673-1-aniketgupta3001@gmail.com","threadId":"66785","inReplyTo":"85924f20-298f-401e-88f7-7fb3f949d0fe@gmail.com","subject":"Re: [PATCH v3 2/3] remote: do not show credentials when relative_url() fails","fromName":"Aniket Gupta","fromEmail":"aniketgupta3001@gmail.com","sentAt":"2026-11-09T10:39:16Z","receivedAt":"2026-11-09T10:39:16Z","isPatch":true,"sender":{"key":"aniketgupta3001@gmail.com","avatar":null},"body":"> I'm less convinced on this factor. I understand anonymizing the URL if\n> we are sending it to a location that is perhaps \"less trusted\" (like\n> trace logs) but the user asked us to operate on a given URL that caused\n> problems, so they should know the string that caused problems.\n\nI answered this on the cover letter by mistake. Here it is again. Apologies for the spam.\n\nFair point. I tried it with a password in the remote URL but the \"failed\nto download bundle from URI\" warning prints it as is. I think this patch\nwill only cover this one message. The reason I did it is that git\nalready hides the password when it shows a remote URL. For eg. in the\n\"From\" line of fetch. It is a separate patch so it is easy to drop if\nyou and Patrick think it is not worth it.\n\n"},{"id":"557922","messageId":"20261109105653.397878-1-aniketgupta3001@gmail.com","threadId":"66785","inReplyTo":"avGR422rPHr1Orv5@pks.im","subject":"Re: [PATCH v3 0/3] bundle-uri: do not die on unresolvable relative URIs","fromName":"Aniket Gupta","fromEmail":"aniketgupta3001@gmail.com","sentAt":"2026-11-09T10:56:53Z","receivedAt":"2026-11-09T10:56:53Z","isPatch":true,"sender":{"key":"aniketgupta3001@gmail.com","avatar":null},"body":"> Huh, where does this quote come from? It's certainly not part of the\n> mail you reply to. Also, you stripped all necessary context for somebody\n> to know what this was even talking about.\n\nApologies. That line is from Stolee's review of patch 2. I replied on the wrong mail. I have answered on patch 2 thread with context: https://lore.kernel.org/git/20261109103916.397673-1-aniketgupta3001@gmail.com/\n\n> But the other part of patch 2 should definitely be retained in my\n> opinion, because printing an error with the URL after we have trimmed\n> \"../\" components off of it is just plain not useful.\n\nUnderstood. I will keep that part.\n\n"}]}