From: Junio C Hamano Date: Fri, 17 Jun 2022 17:33:32 +0000 (-0700) Subject: Merge branch 'ab/credentials-in-url-more' X-Git-Tag: v2.37.0-rc1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f5a382aa5eb54509a4de4d399d8b35c48d91c65;p=thirdparty%2Fgit.git Merge branch 'ab/credentials-in-url-more' Rename fetch.credentialsInUrl to transfer.credentialsInUrl as the single configuration variable should work both in pushing and fetching. * ab/credentials-in-url-more: transfer doc: move fetch.credentialsInUrl to "transfer" config namespace fetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate --- 7f5a382aa5eb54509a4de4d399d8b35c48d91c65 diff --cc Documentation/RelNotes/2.37.0.txt index e491a4b7ba,9902a74f34..bf00ccc437 --- a/Documentation/RelNotes/2.37.0.txt +++ b/Documentation/RelNotes/2.37.0.txt @@@ -54,18 -54,11 +54,20 @@@ UI, Workflows & Feature * Update the doctype written in gitweb output to xhtml5. - * The "fetch.credentialsInUrl" configuration variable controls what - happens when a URL with embedded login credential is used. + * The "transfer.credentialsInUrl" configuration variable controls what + happens when a URL with embedded login credential is used on either + "fetch" or "push". Credentials are currently only detected in + `remote..url` config, not `remote..pushurl`. + * "git revert" learns "--reference" option to use more human-readable + reference to the commit it reverts in the message template it + prepares for the user. + + * Various error messages that talk about the removal of + "--preserve-merges" in "rebase" have been strengthened, and "rebase + --abort" learned to get out of a state that was left by an earlier + use of the option. + Performance, Internal Implementation, Development Support etc. diff --cc t/t5516-fetch-push.sh index c1220b2ed3,79d8a7b367..541adbb310 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@@ -1834,12 -1834,12 +1834,12 @@@ test_expect_success 'refuse to push a h test_dir_is_empty testrepo/.git/objects/pack ' -test_expect_success 'fetch warns or fails when using username:password' ' +test_expect_success LIBCURL 'fetch warns or fails when using username:password' ' message="URL '\''https://username:@localhost/'\'' uses plaintext credentials" && - test_must_fail git -c fetch.credentialsInUrl=allow fetch https://username:password@localhost 2>err && + test_must_fail git -c transfer.credentialsInUrl=allow fetch https://username:password@localhost 2>err && ! grep "$message" err && - test_must_fail git -c fetch.credentialsInUrl=warn fetch https://username:password@localhost 2>err && + test_must_fail git -c transfer.credentialsInUrl=warn fetch https://username:password@localhost 2>err && grep "warning: $message" err >warnings && test_line_count = 3 warnings && @@@ -1853,14 -1853,14 +1853,14 @@@ ' -test_expect_success 'push warns or fails when using username:password' ' +test_expect_success LIBCURL 'push warns or fails when using username:password' ' message="URL '\''https://username:@localhost/'\'' uses plaintext credentials" && - test_must_fail git -c fetch.credentialsInUrl=allow push https://username:password@localhost 2>err && + test_must_fail git -c transfer.credentialsInUrl=allow push https://username:password@localhost 2>err && ! grep "$message" err && - test_must_fail git -c fetch.credentialsInUrl=warn push https://username:password@localhost 2>err && + test_must_fail git -c transfer.credentialsInUrl=warn push https://username:password@localhost 2>err && grep "warning: $message" err >warnings && - test_must_fail git -c fetch.credentialsInUrl=die push https://username:password@localhost 2>err && + test_must_fail git -c transfer.credentialsInUrl=die push https://username:password@localhost 2>err && grep "fatal: $message" err >warnings && test_line_count = 1 warnings ' diff --cc t/t5601-clone.sh index eeed233362,e6a248bbdc..cf3be0584f --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@@ -71,12 -71,12 +71,12 @@@ test_expect_success 'clone respects GIT ' -test_expect_success 'clone warns or fails when using username:password' ' +test_expect_success LIBCURL 'clone warns or fails when using username:password' ' message="URL '\''https://username:@localhost/'\'' uses plaintext credentials" && - test_must_fail git -c fetch.credentialsInUrl=allow clone https://username:password@localhost attempt1 2>err && + test_must_fail git -c transfer.credentialsInUrl=allow clone https://username:password@localhost attempt1 2>err && ! grep "$message" err && - test_must_fail git -c fetch.credentialsInUrl=warn clone https://username:password@localhost attempt2 2>err && + test_must_fail git -c transfer.credentialsInUrl=warn clone https://username:password@localhost attempt2 2>err && grep "warning: $message" err >warnings && test_line_count = 2 warnings && @@@ -89,8 -89,8 +89,8 @@@ test_line_count = 1 warnings ' -test_expect_success 'clone does not detect username:password when it is https://username@domain:port/' ' +test_expect_success LIBCURL 'clone does not detect username:password when it is https://username@domain:port/' ' - test_must_fail git -c fetch.credentialsInUrl=warn clone https://username@localhost:8080 attempt3 2>err && + test_must_fail git -c transfer.credentialsInUrl=warn clone https://username@localhost:8080 attempt3 2>err && ! grep "uses plaintext credentials" err '