{"thread":{"id":"62625","subject":"[PATCH 0/5] remote: announce removal of \"branches/\" and \"remotes/\"","startedAt":"2024-12-11T10:56:54Z","lastAt":"2025-02-26T09:21:29Z","messageCount":47,"participants":["Patrick Steinhardt","Kristoffer Haugsbakk","Christian Couder","Junio C Hamano","rsbecker@nexbridge.com","Robert Coup","Jakub Wilk"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"508976","messageId":"20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im","threadId":"62625","inReplyTo":null,"subject":"[PATCH 0/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-11T10:56:36Z","receivedAt":"2024-12-11T10:56:54Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nback when Git was in its infancy, remotes were configured via separate\nfiles in \"branches/\" (back in 2005). This mechanism was replaced later\nthat year with the \"remotes/\" directory. These mechanism have evenutally\nbeen replaced by config-based remotes, and it is very unlikely that\nanybody still uses these directories to configure their remotes. Both of\nthese directories have been marked as deprecated, one in 2005 and the\nother one in 2011.\n\nThis patch series follows through with the deprecation of these and\nannounces them for removal in Git 3.0. Furthermore, it creates the infra\nto compile Git with such breaking changes enabled and wires up a CI job\nboth for GitHub and GitLab to test those breaking changes.\n\nThe series is based on top caacdb5dfd (The fifteenth batch, 2024-12-10)\nwith ps/build at 904339edbd (Introduce support for the Meson build\nsystem, 2024-12-06) merged into it.\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (5):\n      Makefile: wire up build option for deprecated features\n      ci: merge linux-gcc-default into linux-gcc\n      ci: repurpose \"linux-gcc\" job for deprecations\n      builtin/pack-redundant: remove subcommand with breaking changes\n      remote: announce removal of \"branches/\" and \"remotes/\"\n\n .github/workflows/main.yml             |  6 +----\n .gitlab-ci.yml                         |  6 +----\n Documentation/BreakingChanges.txt      | 25 ++++++++++++++++++\n Documentation/gitrepository-layout.txt |  7 +++--\n GIT-BUILD-OPTIONS.in                   |  1 +\n Makefile                               |  7 +++++\n builtin/remote.c                       |  2 ++\n ci/lib.sh                              |  5 ----\n ci/run-build-and-tests.sh              |  3 ++-\n contrib/buildsystems/CMakeLists.txt    |  1 +\n git.c                                  |  2 ++\n meson.build                            |  6 +++++\n meson_options.txt                      |  2 ++\n remote.c                               |  6 +++++\n remote.h                               |  2 ++\n t/t5323-pack-redundant.sh              |  6 +++++\n t/t5505-remote.sh                      |  6 ++---\n t/t5510-fetch.sh                       | 13 ++++------\n t/t5515-fetch-merge-logic.sh           | 47 ++++++++++++++++++----------------\n t/t5516-fetch-push.sh                  | 14 +++++-----\n t/test-lib.sh                          |  4 +++\n 21 files changed, 112 insertions(+), 59 deletions(-)\n\n\n---\nbase-commit: 713ec79a9091cec60b110d605b418904759982ab\nchange-id: 20241205-pks-remote-branches-deprecation-037a4389a377\n\n"},{"id":"508977","messageId":"20241211-pks-remote-branches-deprecation-v1-1-1431e2369135@pks.im","threadId":"62625","inReplyTo":"20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im","subject":"[PATCH 1/5] Makefile: wire up build option for deprecated features","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-11T10:56:37Z","receivedAt":"2024-12-11T10:56:55Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"With 57ec9254eb (docs: introduce document to announce breaking changes,\n2024-06-14), we have introduced a new document that tracks upcoming\nbreaking changes in the Git project. In 2454970930 (BreakingChanges:\nearly adopter option, 2024-10-11) we have amended the document a bit to\nmention that any introduced breaking changes must be accompanied by\nlogic that allows us to easily enable the breaking change at runtime.\nWhile we already have two breaking changes lined up, neither of them has\nsuch a switch because they predate those instructions.\n\nIntroduce the proposed `WITH_BREAKING_CHANGES` preprocessor macro and\nwire it up with both our Makefiles and Meson.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n GIT-BUILD-OPTIONS.in                | 1 +\n Makefile                            | 5 +++++\n contrib/buildsystems/CMakeLists.txt | 1 +\n meson.build                         | 6 ++++++\n meson_options.txt                   | 2 ++\n t/test-lib.sh                       | 4 ++++\n 6 files changed, 19 insertions(+)\n\ndiff --git a/GIT-BUILD-OPTIONS.in b/GIT-BUILD-OPTIONS.in\nindex f651116102ae2977622dccd12b199fe7ad65af99..f1d0ecf123031dd13232cc63e100da528bfea16a 100644\n--- a/GIT-BUILD-OPTIONS.in\n+++ b/GIT-BUILD-OPTIONS.in\n@@ -45,3 +45,4 @@ GITWEBDIR=@GITWEBDIR@\n USE_GETTEXT_SCHEME=@USE_GETTEXT_SCHEME@\n LOCALEDIR=@LOCALEDIR@\n BROKEN_PATH_FIX=@BROKEN_PATH_FIX@\n+WITH_BREAKING_CHANGES=@WITH_BREAKING_CHANGES@\ndiff --git a/Makefile b/Makefile\nindex 06f01149ecf399ae4bb1932188a007948d767283..dc3c980aa7a4f42d27ed72415a636ac82b2a5684 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2230,6 +2230,10 @@ ifdef FSMONITOR_OS_SETTINGS\n \tCOMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_OS_SETTINGS).o\n endif\n \n+ifdef WITH_BREAKING_CHANGES\n+\tBASIC_CFLAGS += -DWITH_BREAKING_CHANGES\n+endif\n+\n ifeq ($(TCLTK_PATH),)\n NO_TCLTK = NoThanks\n endif\n@@ -3187,6 +3191,7 @@ GIT-BUILD-OPTIONS: FORCE\n \t\t-e \"s|@USE_GETTEXT_SCHEME@|\\'$(USE_GETTEXT_SCHEME)\\'|\" \\\n \t\t-e \"s|@LOCALEDIR@|\\'$(localedir_SQ)\\'|\" \\\n \t\t-e \"s!@BROKEN_PATH_FIX@!\\'$(BROKEN_PATH_FIX)\\'!\" \\\n+\t\t-e \"s|@WITH_BREAKING_CHANGES@|\\'$(WITH_BREAKING_CHANGES)\\'|\" \\\n \t\tGIT-BUILD-OPTIONS.in >$@+\n \t@if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo \"Unsubstituted build options in $@\" >&2 && exit 1; fi\n \t@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 49904ca8a93981c514540bad5efa6833ddd14426..63d008892848c20d5937d9a624a480f700b19498 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -1198,6 +1198,7 @@ string(REPLACE \"@GITWEBDIR@\" \"'${GITWEBDIR}'\" git_build_options \"${git_build_opt\n string(REPLACE \"@USE_GETTEXT_SCHEME@\" \"\" git_build_options \"${git_build_options}\")\n string(REPLACE \"@LOCALEDIR@\" \"'${LOCALEDIR}'\" git_build_options \"${git_build_options}\")\n string(REPLACE \"@BROKEN_PATH_FIX@\" \"\" git_build_options \"${git_build_options}\")\n+string(REPLACE \"@WITH_BREAKING_CHANGES@\" \"\" git_build_options \"${git_build_options}\")\n if(USE_VCPKG)\n \tstring(APPEND git_build_options \"PATH=\\\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\\\"\\n\")\n endif()\ndiff --git a/meson.build b/meson.build\nindex 0dccebcdf16b07650d943e53643f0e09e2975cc9..316cd9326437876828a88d96a1bc93d503199900 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -644,6 +644,12 @@ build_options_config.set('GIT_TEST_UTF8_LOCALE', '')\n build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))\n build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n \n+if get_option('breaking_changes')\n+  build_options_config.set('WITH_BREAKING_CHANGES', 'YesPlease')\n+else\n+  build_options_config.set('WITH_BREAKING_CHANGES', '')\n+endif\n+\n if get_option('sane_tool_path') != ''\n   build_options_config.set_quoted('BROKEN_PATH_FIX', 's|^\\# @BROKEN_PATH_FIX@$|git_broken_path_fix \"' + get_option('sane_tool_path') + '\"|')\n else\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 32a72139bae870745d9131cc9086a4594826be91..800e518d959c4143812f8840415b99a593667a8d 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -43,6 +43,8 @@ option('sha256_backend', type: 'combo', choices: ['openssl', 'nettle', 'gcrypt',\n   description: 'The backend used for hashing objects with the SHA256 object format')\n \n # Build tweaks.\n+option('breaking_changes', type: 'boolean', value: false,\n+  description: 'Enable upcoming breaking changes.')\n option('macos_use_homebrew_gettext', type: 'boolean', value: true,\n   description: 'Use gettext from Homebrew instead of the slightly-broken system-provided one.')\n \ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 62dfcc4aaf959d0cf066d07663d939e14f92485c..6e423f655d35adf5a2d4f8b3a78d9e8c1119caab 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1864,6 +1864,10 @@ test_lazy_prereq CURL '\n \tcurl --version\n '\n \n+test_lazy_prereq WITHOUT_BREAKING_CHANGES '\n+\ttest -z \"$WITH_BREAKING_CHANGES\"\n+'\n+\n # SHA1 is a test if the hash algorithm in use is SHA-1.  This is both for tests\n # which will not work with other hash algorithms and tests that work but don't\n # test anything meaningful (e.g. special values which cause short collisions).\n\n-- \n2.47.1.447.ga7e8429e30.dirty\n\n"},{"id":"508978","messageId":"20241211-pks-remote-branches-deprecation-v1-2-1431e2369135@pks.im","threadId":"62625","inReplyTo":"20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im","subject":"[PATCH 2/5] ci: merge linux-gcc-default into linux-gcc","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-11T10:56:38Z","receivedAt":"2024-12-11T10:56:57Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The \"linux-gcc-default\" job is mostly doing the same as the \"linux-gcc\"\njob, except for a couple of minor differences:\n\n  - We use an explicit GCC version instead of the default version\n    provided by the distribution. We have other jobs that test with\n    \"gcc-8\", making this distinction pointless.\n\n  - We don't set up the Python version explicitly, and instead use the\n    default Python version. Python 2 has been end-of-life for quite a\n    while now though, making this distinction less interesting.\n\n  - We set up the default branch name to be \"main\" in \"linux-gcc\". We\n    have other testcases that don't and also some that explicitly use\n    \"master\".\n\nSo overall, the job does not add much to our test coverage. Merge it\ninto our \"linux-gcc\" job to reduce our test matrix a bit.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n .github/workflows/main.yml | 4 ----\n .gitlab-ci.yml             | 4 ----\n ci/lib.sh                  | 5 -----\n 3 files changed, 13 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 808ddc19b8a799abc414c6d6ba078a6e5be6bdfb..32d35d2257812f02121b20c3cae342d626481553 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -271,7 +271,6 @@ jobs:\n             pool: ubuntu-latest\n           - jobname: linux-gcc\n             cc: gcc\n-            cc_package: gcc-8\n             pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\n             cc: gcc\n@@ -286,9 +285,6 @@ jobs:\n           - jobname: osx-gcc\n             cc: gcc-13\n             pool: macos-13\n-          - jobname: linux-gcc-default\n-            cc: gcc\n-            pool: ubuntu-latest\n           - jobname: linux-leaks\n             cc: gcc\n             pool: ubuntu-latest\ndiff --git a/.gitlab-ci.yml b/.gitlab-ci.yml\nindex a1bc92893f27d6dd404133686b71c8061e55618c..b86bb0bdb3363e06e6fe4195c34babd67cf7e8cc 100644\n--- a/.gitlab-ci.yml\n+++ b/.gitlab-ci.yml\n@@ -46,14 +46,10 @@ test:linux:\n       - jobname: linux-gcc\n         image: ubuntu:20.04\n         CC: gcc\n-        CC_PACKAGE: gcc-8\n       - jobname: linux-TEST-vars\n         image: ubuntu:20.04\n         CC: gcc\n         CC_PACKAGE: gcc-8\n-      - jobname: linux-gcc-default\n-        image: ubuntu:latest\n-        CC: gcc\n       - jobname: linux-leaks\n         image: ubuntu:latest\n         CC: gcc\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 930f98d7228166c37c236beb062b14675fb68ef3..e67c481d4fe08d0ebc3253a7a832a96f65c79ffe 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -328,11 +328,6 @@ export SKIP_DASHED_BUILT_INS=YesPlease\n \n case \"$distro\" in\n ubuntu-*)\n-\tif test \"$jobname\" = \"linux-gcc-default\"\n-\tthen\n-\t\tbreak\n-\tfi\n-\n \t# Python 2 is end of life, and Ubuntu 23.04 and newer don't actually\n \t# have it anymore. We thus only test with Python 2 on older LTS\n \t# releases.\n\n-- \n2.47.1.447.ga7e8429e30.dirty\n\n"},{"id":"508979","messageId":"20241211-pks-remote-branches-deprecation-v1-3-1431e2369135@pks.im","threadId":"62625","inReplyTo":"20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im","subject":"[PATCH 3/5] ci: repurpose \"linux-gcc\" job for deprecations","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-11T10:56:39Z","receivedAt":"2024-12-11T10:56:58Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The \"linux-gcc\" job isn't all that interesting by itself and can be\nconsidered more or less the \"standard\" job: it is running with a\nreasonably up-to-date image and uses GCC as a compiler, both of which we\nalready cover in other jobs.\n\nThere is one exception though: we change the default branch to be \"main\"\ninstead of \"master\", so it is forging ahead a bit into the future to\nmake sure that this change does not cause havoc. So let's expand on this\na bit and also add the new \"WITH_BREAKING_CHANGES\" flag to the mix.\n\nRename the job to \"linux-breaking-changes\" accordingly.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n .github/workflows/main.yml | 2 +-\n .gitlab-ci.yml             | 2 +-\n ci/run-build-and-tests.sh  | 3 ++-\n 3 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 32d35d2257812f02121b20c3cae342d626481553..46b96fb96cc6e2659fe0b4b640f7e671587d059a 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -269,7 +269,7 @@ jobs:\n           - jobname: linux-reftable\n             cc: clang\n             pool: ubuntu-latest\n-          - jobname: linux-gcc\n+          - jobname: linux-breaking-changes\n             cc: gcc\n             pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\ndiff --git a/.gitlab-ci.yml b/.gitlab-ci.yml\nindex b86bb0bdb3363e06e6fe4195c34babd67cf7e8cc..492e5d9082dbdb3389c173f2b5a45fe43f4bea41 100644\n--- a/.gitlab-ci.yml\n+++ b/.gitlab-ci.yml\n@@ -43,7 +43,7 @@ test:linux:\n       - jobname: linux-reftable\n         image: ubuntu:latest\n         CC: clang\n-      - jobname: linux-gcc\n+      - jobname: linux-breaking-changes\n         image: ubuntu:20.04\n         CC: gcc\n       - jobname: linux-TEST-vars\ndiff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh\nindex 2e28d02b20f2469afddc4e04fdbd18465babb1ef..2ccd812fb4e025be3b8e9ab2ec6ae44e92944ab0 100755\n--- a/ci/run-build-and-tests.sh\n+++ b/ci/run-build-and-tests.sh\n@@ -13,8 +13,9 @@ esac\n run_tests=t\n \n case \"$jobname\" in\n-linux-gcc)\n+linux-breaking-changes)\n \texport GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n+\texport WITH_BREAKING_CHANGES=YesPlease\n \t;;\n linux-TEST-vars)\n \texport GIT_TEST_SPLIT_INDEX=yes\n\n-- \n2.47.1.447.ga7e8429e30.dirty\n\n"},{"id":"508980","messageId":"20241211-pks-remote-branches-deprecation-v1-4-1431e2369135@pks.im","threadId":"62625","inReplyTo":"20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im","subject":"[PATCH 4/5] builtin/pack-redundant: remove subcommand with breaking changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-11T10:56:40Z","receivedAt":"2024-12-11T10:56:59Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The git-pack-redundant(1) subcommand has been announced for removal with\n53a92c9552 (Documentation/BreakingChanges: announce removal of\ngit-pack-redundant(1), 2024-09-02). Stop compiling the subcommand in\ncase the `WITH_BREAKING_CHANGES` build flag is set.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Makefile                  | 2 ++\n git.c                     | 2 ++\n t/t5323-pack-redundant.sh | 6 ++++++\n 3 files changed, 10 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex dc3c980aa7a4f42d27ed72415a636ac82b2a5684..e6b0d859803ac4d53079ec2a39143441a5662203 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1278,7 +1278,9 @@ BUILTIN_OBJS += builtin/mv.o\n BUILTIN_OBJS += builtin/name-rev.o\n BUILTIN_OBJS += builtin/notes.o\n BUILTIN_OBJS += builtin/pack-objects.o\n+ifndef WITH_BREAKING_CHANGES\n BUILTIN_OBJS += builtin/pack-redundant.o\n+endif\n BUILTIN_OBJS += builtin/pack-refs.o\n BUILTIN_OBJS += builtin/patch-id.o\n BUILTIN_OBJS += builtin/prune-packed.o\ndiff --git a/git.c b/git.c\nindex 46b3c740c5d665388917c6eee3052cc3ef8368f2..a13c32bcdc694460fcafe8079d3aa6e8caea1b4c 100644\n--- a/git.c\n+++ b/git.c\n@@ -589,7 +589,9 @@ static struct cmd_struct commands[] = {\n \t{ \"name-rev\", cmd_name_rev, RUN_SETUP },\n \t{ \"notes\", cmd_notes, RUN_SETUP },\n \t{ \"pack-objects\", cmd_pack_objects, RUN_SETUP },\n+#ifndef WITH_BREAKING_CHANGES\n \t{ \"pack-redundant\", cmd_pack_redundant, RUN_SETUP | NO_PARSEOPT },\n+#endif\n \t{ \"pack-refs\", cmd_pack_refs, RUN_SETUP },\n \t{ \"patch-id\", cmd_patch_id, RUN_SETUP_GENTLY | NO_PARSEOPT },\n \t{ \"pickaxe\", cmd_blame, RUN_SETUP },\ndiff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh\nindex 8dbbcc5e51c06d7c5f56fcb3107860fcb66a5106..688cd9706c876a7edcaf0bcd642ae08ece188d4d 100755\n--- a/t/t5323-pack-redundant.sh\n+++ b/t/t5323-pack-redundant.sh\n@@ -36,6 +36,12 @@ relationship between packs and objects is as follows:\n \n . ./test-lib.sh\n \n+if ! test_have_prereq WITHOUT_BREAKING_CHANGES\n+then\n+\tskip_all='skipping git-pack-redundant tests; built with breaking changes'\n+\ttest_done\n+fi\n+\n main_repo=main.git\n shared_repo=shared.git\n \n\n-- \n2.47.1.447.ga7e8429e30.dirty\n\n"},{"id":"508981","messageId":"20241211-pks-remote-branches-deprecation-v1-5-1431e2369135@pks.im","threadId":"62625","inReplyTo":"20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im","subject":"[PATCH 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-11T10:56:41Z","receivedAt":"2024-12-11T10:57:00Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Back when Git was in its infancy, remotes were configured via separate\nfiles in \"branches/\" (back in 2005). This mechanism was replaced later\nthat year with the \"remotes/\" directory. These mechanism have evenutally\nbeen replaced by config-based remotes, and it is very unlikely that\nanybody still uses these directories to configure their remotes.\n\nBoth of these directories have been marked as deprecated, one in 2005\nand the other one in 2011. Follow through with the deprecation and\nfinally announce the removal of these features in Git 3.0.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/BreakingChanges.txt      | 25 ++++++++++++++++++\n Documentation/gitrepository-layout.txt |  7 +++--\n builtin/remote.c                       |  2 ++\n remote.c                               |  6 +++++\n remote.h                               |  2 ++\n t/t5505-remote.sh                      |  6 ++---\n t/t5510-fetch.sh                       | 13 ++++------\n t/t5515-fetch-merge-logic.sh           | 47 ++++++++++++++++++----------------\n t/t5516-fetch-push.sh                  | 14 +++++-----\n 9 files changed, 79 insertions(+), 43 deletions(-)\n\ndiff --git a/Documentation/BreakingChanges.txt b/Documentation/BreakingChanges.txt\nindex 27acff86db4883a7d7967343c61711959b75a473..f9a3bc982efc1deb6570d1911e9f34731c6c2864 100644\n--- a/Documentation/BreakingChanges.txt\n+++ b/Documentation/BreakingChanges.txt\n@@ -154,6 +154,31 @@ Cf. <xmqq1rjuz6n3.fsf_-_@gitster.c.googlers.com>,\n     <CAKvOHKAFXQwt4D8yUCCkf_TQL79mYaJ=KAKhtpDNTvHJFuX1NA@mail.gmail.com>,\n     <20230323204047.GA9290@coredump.intra.peff.net>,\n \n+* Support for storing shorthands for remote URLs in \"$GIT_COMMON_DIR/branches/\"\n+  and \"$GIT_COMMON_DIR/remotes/\" has been long superseded by storing remotes in\n+  the repository configuration.\n++\n+The mechanism has originally been introduced in f170e4b39d ([PATCH] fetch/pull:\n+short-hand notation for remote repositories., 2005-07-16) and was superseded by\n+6687f8fea2 ([PATCH] Use .git/remote/origin, not .git/branches/origin.,\n+2005-08-20), where we switched from \".git/branches/\" to \".git/remotes/\". That\n+commit already mentions an upcoming deprecation of the \".git/branches/\"\n+directory, and starting with a1d4aa7424 (Add repository-layout document.,\n+2005-09-01) we have also marked this layout as deprecated. Eventually we also\n+started to migrate away from \".git/remotes/\" in favor of config-based remotes,\n+and we have marked the directory as legacy in 3d3d282146 (Documentation:\n+Grammar correction, wording fixes and cleanup, 2011-08-23)\n++\n+As our documentation mentions, these directories are not to be found in modern\n+repositories at all and most users aren't even aware of these mechanisms. They\n+have been deprecated for almost 20 years and 14 years respectively, and I am\n+not aware of any reason why anybody would want to use these mechanisms.\n+Furthermore, the \".git/branches/\" directory is noadays misleadingly named and\n+may cause confusion as \"branches\" are almost exclusively used in the context of\n+references.\n++\n+These features will be removed.\n+\n == Superseded features that will not be deprecated\n \n Some features have gained newer replacements that aim to improve the design in\ndiff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt\nindex fa8b51daf08775f3d666a910d9b00486627e02af..85911ca8ea0b222ab9cc3dc2dd99c5136c72bd2b 100644\n--- a/Documentation/gitrepository-layout.txt\n+++ b/Documentation/gitrepository-layout.txt\n@@ -153,7 +153,7 @@ config.worktree::\n \tlinkgit:git-worktree[1]).\n \n branches::\n-\tA slightly deprecated way to store shorthands to be used\n+\tA deprecated way to store shorthands to be used\n \tto specify a URL to 'git fetch', 'git pull' and 'git push'.\n \tA file can be stored as `branches/<name>` and then\n \t'name' can be given to these commands in place of\n@@ -162,7 +162,8 @@ branches::\n \tand not likely to be found in modern repositories. This\n \tdirectory is ignored if $GIT_COMMON_DIR is set and\n \t\"$GIT_COMMON_DIR/branches\" will be used instead.\n-\n++\n+Git will stop reading remotes from this directory in Git 3.0.\n \n hooks::\n \tHooks are customization scripts used by various Git\n@@ -238,6 +239,8 @@ remotes::\n \tand not likely to be found in modern repositories. This\n \tdirectory is ignored if $GIT_COMMON_DIR is set and\n \t\"$GIT_COMMON_DIR/remotes\" will be used instead.\n++\n+Git will stop reading remotes from this directory in Git 3.0.\n \n logs::\n \tRecords of changes made to refs are stored in this directory.\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 1ad3e70a6b438a3c4446b16c02dc5c23c7fa14be..e565b2b3fec8bf2e4182e85d8d08953a14416881 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -640,10 +640,12 @@ static int migrate_file(struct remote *remote)\n \tstrbuf_addf(&buf, \"remote.%s.fetch\", remote->name);\n \tfor (i = 0; i < remote->fetch.nr; i++)\n \t\tgit_config_set_multivar(buf.buf, remote->fetch.items[i].raw, \"^$\", 0);\n+#ifndef WITH_BREAKING_CHANGES\n \tif (remote->origin == REMOTE_REMOTES)\n \t\tunlink_or_warn(git_path(\"remotes/%s\", remote->name));\n \telse if (remote->origin == REMOTE_BRANCHES)\n \t\tunlink_or_warn(git_path(\"branches/%s\", remote->name));\n+#endif /* WITH_BREAKING_CHANGES */\n \tstrbuf_release(&buf);\n \n \treturn 0;\ndiff --git a/remote.c b/remote.c\nindex 10104d11e3cba1908cd35f22b54e167755770404..55e91fab47197313fd8c2c1c5f73fcd46b4df4f7 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -293,6 +293,7 @@ static void add_instead_of(struct rewrite *rewrite, const char *instead_of)\n \trewrite->instead_of_nr++;\n }\n \n+#ifndef WITH_BREAKING_CHANGES\n static const char *skip_spaces(const char *s)\n {\n \twhile (isspace(*s))\n@@ -374,6 +375,7 @@ static void read_branches_file(struct remote_state *remote_state,\n \tstrbuf_release(&buf);\n \tfree(to_free);\n }\n+#endif /* WITH_BREAKING_CHANGES */\n \n static int handle_config(const char *key, const char *value,\n \t\t\t const struct config_context *ctx, void *cb)\n@@ -572,6 +574,7 @@ static void read_config(struct repository *repo, int early)\n \talias_all_urls(repo->remote_state);\n }\n \n+#ifndef WITH_BREAKING_CHANGES\n static int valid_remote_nick(const char *name)\n {\n \tif (!name[0] || is_dot_or_dotdot(name))\n@@ -583,6 +586,7 @@ static int valid_remote_nick(const char *name)\n \t\t\treturn 0;\n \treturn 1;\n }\n+#endif /* WITH_BREAKING_CHANGES */\n \n static const char *remotes_remote_for_branch(struct remote_state *remote_state,\n \t\t\t\t\t     struct branch *branch,\n@@ -725,12 +729,14 @@ remotes_remote_get_1(struct remote_state *remote_state, const char *name,\n \t\t\t\t   &name_given);\n \n \tret = make_remote(remote_state, name, 0);\n+#ifndef WITH_BREAKING_CHANGES\n \tif (valid_remote_nick(name) && have_git_dir()) {\n \t\tif (!valid_remote(ret))\n \t\t\tread_remotes_file(remote_state, ret);\n \t\tif (!valid_remote(ret))\n \t\t\tread_branches_file(remote_state, ret);\n \t}\n+#endif /* WITH_BREAKING_CHANGES */\n \tif (name_given && !valid_remote(ret))\n \t\tadd_url_alias(remote_state, ret, name);\n \tif (!valid_remote(ret))\ndiff --git a/remote.h b/remote.h\nindex a7e5c4e07c53ce5a0f6d852ce9f9233e6bb61550..45b0c9babb1374a05471e86de2c248972adb2aae 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -21,8 +21,10 @@ struct transport_ls_refs_options;\n enum {\n \tREMOTE_UNCONFIGURED = 0,\n \tREMOTE_CONFIG,\n+#ifndef WITH_BREAKING_CHANGES\n \tREMOTE_REMOTES,\n \tREMOTE_BRANCHES\n+#endif /* WITH_BREAKING_CHANGES */\n };\n \n struct rewrite {\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex 08424e878e104cc19a43960b987cf868f542cad2..e96ac8c7676ceeb7299c8f0839d9654d527ae084 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -1007,7 +1007,7 @@ Pull: refs/heads/main:refs/heads/origin\n Pull: refs/heads/next:refs/heads/origin2\n EOF\n \n-test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '\n \tgit clone one five &&\n \torigin_url=$(pwd)/one &&\n \t(\n@@ -1033,7 +1033,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \t)\n '\n \n-test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '\n \tgit clone --template= one six &&\n \torigin_url=$(pwd)/one &&\n \t(\n@@ -1049,7 +1049,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \t)\n '\n \n-test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '\n \tgit clone --template= one seven &&\n \t(\n \t\tcd seven &&\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 3b3991ab8678a57fce3ad371e37900fb3c6c426a..04d8a96367910d4687b18a8f725dc365cf2ceedb 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -34,14 +34,11 @@ test_expect_success \"clone and setup child repos\" '\n \tgit clone . three &&\n \t(\n \t\tcd three &&\n-\t\tgit config branch.main.remote two &&\n-\t\tgit config branch.main.merge refs/heads/one &&\n-\t\tmkdir -p .git/remotes &&\n-\t\tcat >.git/remotes/two <<-\\EOF\n-\t\tURL: ../two/.git/\n-\t\tPull: refs/heads/main:refs/heads/two\n-\t\tPull: refs/heads/one:refs/heads/one\n-\t\tEOF\n+\t\tgit config set remote.two.url ../two/.git/ &&\n+\t\tgit config set remote.two.fetch refs/heads/main:refs/heads/two &&\n+\t\tgit config set --append remote.two.fetch refs/heads/one:refs/heads/one &&\n+\t\tgit config set branch.main.remote two &&\n+\t\tgit config set branch.main.merge refs/heads/one\n \t) &&\n \tgit clone . bundle &&\n \tgit clone . seven\ndiff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh\nindex 320d26796d24d8a2281d37220a7bdf73cafaa503..4e6026c6114fb8367136173ea2b7fdbc0baa37fc 100755\n--- a/t/t5515-fetch-merge-logic.sh\n+++ b/t/t5515-fetch-merge-logic.sh\n@@ -104,28 +104,31 @@ test_expect_success setup '\n \tgit config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&\n \tremotes=\"$remotes config-glob\" &&\n \n-\tmkdir -p .git/remotes &&\n-\tcat >.git/remotes/remote-explicit <<-\\EOF &&\n-\tURL: ../.git/\n-\tPull: refs/heads/main:remotes/rem/main\n-\tPull: refs/heads/one:remotes/rem/one\n-\tPull: two:remotes/rem/two\n-\tPull: refs/heads/three:remotes/rem/three\n-\tEOF\n-\tremotes=\"$remotes remote-explicit\" &&\n-\n-\tcat >.git/remotes/remote-glob <<-\\EOF &&\n-\tURL: ../.git/\n-\tPull: refs/heads/*:refs/remotes/rem/*\n-\tEOF\n-\tremotes=\"$remotes remote-glob\" &&\n-\n-\tmkdir -p .git/branches &&\n-\techo \"../.git\" > .git/branches/branches-default &&\n-\tremotes=\"$remotes branches-default\" &&\n-\n-\techo \"../.git#one\" > .git/branches/branches-one &&\n-\tremotes=\"$remotes branches-one\" &&\n+\tif test_have_prereq WITHOUT_BREAKING_CHANGES\n+\tthen\n+\t\tmkdir -p .git/remotes &&\n+\t\tcat >.git/remotes/remote-explicit <<-\\EOF &&\n+\t\tURL: ../.git/\n+\t\tPull: refs/heads/main:remotes/rem/main\n+\t\tPull: refs/heads/one:remotes/rem/one\n+\t\tPull: two:remotes/rem/two\n+\t\tPull: refs/heads/three:remotes/rem/three\n+\t\tEOF\n+\t\tremotes=\"$remotes remote-explicit\" &&\n+\n+\t\tcat >.git/remotes/remote-glob <<-\\EOF &&\n+\t\tURL: ../.git/\n+\t\tPull: refs/heads/*:refs/remotes/rem/*\n+\t\tEOF\n+\t\tremotes=\"$remotes remote-glob\" &&\n+\n+\t\tmkdir -p .git/branches &&\n+\t\techo \"../.git\" > .git/branches/branches-default &&\n+\t\tremotes=\"$remotes branches-default\" &&\n+\n+\t\techo \"../.git#one\" > .git/branches/branches-one &&\n+\t\tremotes=\"$remotes branches-one\"\n+\tfi &&\n \n \tfor remote in $remotes ; do\n \t\tgit config branch.br-$remote.remote $remote &&\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 9d693eb57f7790ddb81cee0b905a101719069562..e705aedbf4a8d57ed188918077b9f82ed8e77b51 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -975,7 +975,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' '\n \t! grep \"warning: updating the current branch\" stderr\n '\n \n-test_expect_success 'fetch with branches' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '\n \tmk_empty testrepo &&\n \tgit branch second $the_first_commit &&\n \tgit checkout second &&\n@@ -991,7 +991,7 @@ test_expect_success 'fetch with branches' '\n \tgit checkout main\n '\n \n-test_expect_success 'fetch with branches containing #' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #' '\n \tmk_empty testrepo &&\n \tmkdir testrepo/.git/branches &&\n \techo \"..#second\" > testrepo/.git/branches/branch2 &&\n@@ -1005,7 +1005,7 @@ test_expect_success 'fetch with branches containing #' '\n \tgit checkout main\n '\n \n-test_expect_success 'push with branches' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '\n \tmk_empty testrepo &&\n \tgit checkout second &&\n \n@@ -1022,7 +1022,7 @@ test_expect_success 'push with branches' '\n \t)\n '\n \n-test_expect_success 'push with branches containing #' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches containing #' '\n \tmk_empty testrepo &&\n \n \ttest_when_finished \"rm -rf .git/branches\" &&\n@@ -1211,18 +1211,16 @@ test_expect_success 'push --porcelain --dry-run rejected' '\n '\n \n test_expect_success 'push --prune' '\n-\tmk_test testrepo heads/main heads/second heads/foo heads/bar &&\n+\tmk_test testrepo heads/main heads/foo heads/bar &&\n \tgit push --prune testrepo : &&\n \tcheck_push_result testrepo $the_commit heads/main &&\n-\tcheck_push_result testrepo $the_first_commit heads/second &&\n \t! check_push_result testrepo $the_first_commit heads/foo heads/bar\n '\n \n test_expect_success 'push --prune refspec' '\n-\tmk_test testrepo tmp/main tmp/second tmp/foo tmp/bar &&\n+\tmk_test testrepo tmp/main tmp/foo tmp/bar &&\n \tgit push --prune testrepo \"refs/heads/*:refs/tmp/*\" &&\n \tcheck_push_result testrepo $the_commit tmp/main &&\n-\tcheck_push_result testrepo $the_first_commit tmp/second &&\n \t! check_push_result testrepo $the_first_commit tmp/foo tmp/bar\n '\n \n\n-- \n2.47.1.447.ga7e8429e30.dirty\n\n"},{"id":"508983","messageId":"c421584f-4eed-4aab-b706-214a36fc4e32@app.fastmail.com","threadId":"62625","inReplyTo":"20241211-pks-remote-branches-deprecation-v1-1-1431e2369135@pks.im","subject":"Re: [PATCH 1/5] Makefile: wire up build option for deprecated features","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2024-12-11T13:06:42Z","receivedAt":"2024-12-11T13:07:05Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Wed, Dec 11, 2024, at 11:56, Patrick Steinhardt wrote:\n> logic that allows us to easily enable the breaking change at runtime.\n\ns/at runtime/at compile-time/\n\n> While we already have two breaking changes lined up, neither of them has\n> such a switch because they predate those instructions.\n>\n> Introduce the proposed `WITH_BREAKING_CHANGES` preprocessor macro and\n> wire it up with both our Makefiles and Meson.\n>\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n"},{"id":"509049","messageId":"Z1vFm2SrbhQxLsxX@pks.im","threadId":"62625","inReplyTo":"c421584f-4eed-4aab-b706-214a36fc4e32@app.fastmail.com","subject":"Re: [PATCH 1/5] Makefile: wire up build option for deprecated features","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-13T05:26:51Z","receivedAt":"2024-12-13T05:27:08Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Dec 11, 2024 at 02:06:42PM +0100, Kristoffer Haugsbakk wrote:\n> On Wed, Dec 11, 2024, at 11:56, Patrick Steinhardt wrote:\n> > logic that allows us to easily enable the breaking change at runtime.\n> \n> s/at runtime/at compile-time/\n\nGood catch, thanks!\n\nPatrick\n"},{"id":"509954","messageId":"20250106-pks-remote-branches-deprecation-v2-0-2ce87c053536@pks.im","threadId":"62625","inReplyTo":"20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im","subject":"[PATCH v2 0/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-06T07:51:32Z","receivedAt":"2025-01-06T07:51:40Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nback when Git was in its infancy, remotes were configured via separate\nfiles in \"branches/\" (back in 2005). This mechanism was replaced later\nthat year with the \"remotes/\" directory. These mechanism have evenutally\nbeen replaced by config-based remotes, and it is very unlikely that\nanybody still uses these directories to configure their remotes. Both of\nthese directories have been marked as deprecated, one in 2005 and the\nother one in 2011.\n\nThis patch series follows through with the deprecation of these and\nannounces them for removal in Git 3.0. Furthermore, it creates the infra\nto compile Git with such breaking changes enabled and wires up a CI job\nboth for GitHub and GitLab to test those breaking changes.\n\nThe series is based on top caacdb5dfd (The fifteenth batch, 2024-12-10)\nwith ps/build at 904339edbd (Introduce support for the Meson build\nsystem, 2024-12-06) merged into it.\n\nChanges in v2:\n- Some small fixes to the deprecation notice of \"branches/\" and\n  \"remotes/\".\n- Some small fixes to commit messages.\n- Link to v1: https://lore.kernel.org/r/20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (5):\n      Makefile: wire up build option for deprecated features\n      ci: merge linux-gcc-default into linux-gcc\n      ci: repurpose \"linux-gcc\" job for deprecations\n      builtin/pack-redundant: remove subcommand with breaking changes\n      remote: announce removal of \"branches/\" and \"remotes/\"\n\n .github/workflows/main.yml             |  6 +----\n .gitlab-ci.yml                         |  6 +----\n Documentation/BreakingChanges.txt      | 25 ++++++++++++++++++\n Documentation/gitrepository-layout.txt |  7 +++--\n GIT-BUILD-OPTIONS.in                   |  1 +\n Makefile                               |  7 +++++\n builtin/remote.c                       |  2 ++\n ci/lib.sh                              |  5 ----\n ci/run-build-and-tests.sh              |  3 ++-\n contrib/buildsystems/CMakeLists.txt    |  1 +\n git.c                                  |  2 ++\n meson.build                            |  6 +++++\n meson_options.txt                      |  2 ++\n remote.c                               |  6 +++++\n remote.h                               |  2 ++\n t/t5323-pack-redundant.sh              |  6 +++++\n t/t5505-remote.sh                      |  6 ++---\n t/t5510-fetch.sh                       | 13 ++++------\n t/t5515-fetch-merge-logic.sh           | 47 ++++++++++++++++++----------------\n t/t5516-fetch-push.sh                  | 14 +++++-----\n t/test-lib.sh                          |  4 +++\n 21 files changed, 112 insertions(+), 59 deletions(-)\n\nRange-diff versus v1:\n\n1:  51bc2fc09e ! 1:  c15229fb98 Makefile: wire up build option for deprecated features\n    @@ Commit message\n         breaking changes in the Git project. In 2454970930 (BreakingChanges:\n         early adopter option, 2024-10-11) we have amended the document a bit to\n         mention that any introduced breaking changes must be accompanied by\n    -    logic that allows us to easily enable the breaking change at runtime.\n    +    logic that allows us to enable the breaking change at compile-time.\n         While we already have two breaking changes lined up, neither of them has\n         such a switch because they predate those instructions.\n     \n2:  71dc627473 = 2:  0131ac856f ci: merge linux-gcc-default into linux-gcc\n3:  8134955d0b = 3:  38a71377c0 ci: repurpose \"linux-gcc\" job for deprecations\n4:  aa986122ea = 4:  a8d18e3499 builtin/pack-redundant: remove subcommand with breaking changes\n5:  b528488559 ! 5:  7445f06776 remote: announce removal of \"branches/\" and \"remotes/\"\n    @@ Commit message\n     \n         Back when Git was in its infancy, remotes were configured via separate\n         files in \"branches/\" (back in 2005). This mechanism was replaced later\n    -    that year with the \"remotes/\" directory. These mechanism have evenutally\n    +    that year with the \"remotes/\" directory. These mechanism have eventually\n         been replaced by config-based remotes, and it is very unlikely that\n         anybody still uses these directories to configure their remotes.\n     \n    @@ Documentation/BreakingChanges.txt: Cf. <xmqq1rjuz6n3.fsf_-_@gitster.c.googlers.c\n     ++\n     +As our documentation mentions, these directories are not to be found in modern\n     +repositories at all and most users aren't even aware of these mechanisms. They\n    -+have been deprecated for almost 20 years and 14 years respectively, and I am\n    ++have been deprecated for almost 20 years and 14 years respectively, and we are\n     +not aware of any reason why anybody would want to use these mechanisms.\n    -+Furthermore, the \".git/branches/\" directory is noadays misleadingly named and\n    ++Furthermore, the \".git/branches/\" directory is nowadays misleadingly named and\n     +may cause confusion as \"branches\" are almost exclusively used in the context of\n     +references.\n     ++\n\n---\nbase-commit: 713ec79a9091cec60b110d605b418904759982ab\nchange-id: 20241205-pks-remote-branches-deprecation-037a4389a377\n\n"},{"id":"509955","messageId":"20250106-pks-remote-branches-deprecation-v2-1-2ce87c053536@pks.im","threadId":"62625","inReplyTo":"20250106-pks-remote-branches-deprecation-v2-0-2ce87c053536@pks.im","subject":"[PATCH v2 1/5] Makefile: wire up build option for deprecated features","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-06T07:51:33Z","receivedAt":"2025-01-06T07:51:40Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"With 57ec9254eb (docs: introduce document to announce breaking changes,\n2024-06-14), we have introduced a new document that tracks upcoming\nbreaking changes in the Git project. In 2454970930 (BreakingChanges:\nearly adopter option, 2024-10-11) we have amended the document a bit to\nmention that any introduced breaking changes must be accompanied by\nlogic that allows us to enable the breaking change at compile-time.\nWhile we already have two breaking changes lined up, neither of them has\nsuch a switch because they predate those instructions.\n\nIntroduce the proposed `WITH_BREAKING_CHANGES` preprocessor macro and\nwire it up with both our Makefiles and Meson.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n GIT-BUILD-OPTIONS.in                | 1 +\n Makefile                            | 5 +++++\n contrib/buildsystems/CMakeLists.txt | 1 +\n meson.build                         | 6 ++++++\n meson_options.txt                   | 2 ++\n t/test-lib.sh                       | 4 ++++\n 6 files changed, 19 insertions(+)\n\ndiff --git a/GIT-BUILD-OPTIONS.in b/GIT-BUILD-OPTIONS.in\nindex f651116102ae2977622dccd12b199fe7ad65af99..f1d0ecf123031dd13232cc63e100da528bfea16a 100644\n--- a/GIT-BUILD-OPTIONS.in\n+++ b/GIT-BUILD-OPTIONS.in\n@@ -45,3 +45,4 @@ GITWEBDIR=@GITWEBDIR@\n USE_GETTEXT_SCHEME=@USE_GETTEXT_SCHEME@\n LOCALEDIR=@LOCALEDIR@\n BROKEN_PATH_FIX=@BROKEN_PATH_FIX@\n+WITH_BREAKING_CHANGES=@WITH_BREAKING_CHANGES@\ndiff --git a/Makefile b/Makefile\nindex 06f01149ecf399ae4bb1932188a007948d767283..dc3c980aa7a4f42d27ed72415a636ac82b2a5684 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2230,6 +2230,10 @@ ifdef FSMONITOR_OS_SETTINGS\n \tCOMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_OS_SETTINGS).o\n endif\n \n+ifdef WITH_BREAKING_CHANGES\n+\tBASIC_CFLAGS += -DWITH_BREAKING_CHANGES\n+endif\n+\n ifeq ($(TCLTK_PATH),)\n NO_TCLTK = NoThanks\n endif\n@@ -3187,6 +3191,7 @@ GIT-BUILD-OPTIONS: FORCE\n \t\t-e \"s|@USE_GETTEXT_SCHEME@|\\'$(USE_GETTEXT_SCHEME)\\'|\" \\\n \t\t-e \"s|@LOCALEDIR@|\\'$(localedir_SQ)\\'|\" \\\n \t\t-e \"s!@BROKEN_PATH_FIX@!\\'$(BROKEN_PATH_FIX)\\'!\" \\\n+\t\t-e \"s|@WITH_BREAKING_CHANGES@|\\'$(WITH_BREAKING_CHANGES)\\'|\" \\\n \t\tGIT-BUILD-OPTIONS.in >$@+\n \t@if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo \"Unsubstituted build options in $@\" >&2 && exit 1; fi\n \t@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 49904ca8a93981c514540bad5efa6833ddd14426..63d008892848c20d5937d9a624a480f700b19498 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -1198,6 +1198,7 @@ string(REPLACE \"@GITWEBDIR@\" \"'${GITWEBDIR}'\" git_build_options \"${git_build_opt\n string(REPLACE \"@USE_GETTEXT_SCHEME@\" \"\" git_build_options \"${git_build_options}\")\n string(REPLACE \"@LOCALEDIR@\" \"'${LOCALEDIR}'\" git_build_options \"${git_build_options}\")\n string(REPLACE \"@BROKEN_PATH_FIX@\" \"\" git_build_options \"${git_build_options}\")\n+string(REPLACE \"@WITH_BREAKING_CHANGES@\" \"\" git_build_options \"${git_build_options}\")\n if(USE_VCPKG)\n \tstring(APPEND git_build_options \"PATH=\\\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\\\"\\n\")\n endif()\ndiff --git a/meson.build b/meson.build\nindex 0dccebcdf16b07650d943e53643f0e09e2975cc9..316cd9326437876828a88d96a1bc93d503199900 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -644,6 +644,12 @@ build_options_config.set('GIT_TEST_UTF8_LOCALE', '')\n build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))\n build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n \n+if get_option('breaking_changes')\n+  build_options_config.set('WITH_BREAKING_CHANGES', 'YesPlease')\n+else\n+  build_options_config.set('WITH_BREAKING_CHANGES', '')\n+endif\n+\n if get_option('sane_tool_path') != ''\n   build_options_config.set_quoted('BROKEN_PATH_FIX', 's|^\\# @BROKEN_PATH_FIX@$|git_broken_path_fix \"' + get_option('sane_tool_path') + '\"|')\n else\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 32a72139bae870745d9131cc9086a4594826be91..800e518d959c4143812f8840415b99a593667a8d 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -43,6 +43,8 @@ option('sha256_backend', type: 'combo', choices: ['openssl', 'nettle', 'gcrypt',\n   description: 'The backend used for hashing objects with the SHA256 object format')\n \n # Build tweaks.\n+option('breaking_changes', type: 'boolean', value: false,\n+  description: 'Enable upcoming breaking changes.')\n option('macos_use_homebrew_gettext', type: 'boolean', value: true,\n   description: 'Use gettext from Homebrew instead of the slightly-broken system-provided one.')\n \ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 62dfcc4aaf959d0cf066d07663d939e14f92485c..6e423f655d35adf5a2d4f8b3a78d9e8c1119caab 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1864,6 +1864,10 @@ test_lazy_prereq CURL '\n \tcurl --version\n '\n \n+test_lazy_prereq WITHOUT_BREAKING_CHANGES '\n+\ttest -z \"$WITH_BREAKING_CHANGES\"\n+'\n+\n # SHA1 is a test if the hash algorithm in use is SHA-1.  This is both for tests\n # which will not work with other hash algorithms and tests that work but don't\n # test anything meaningful (e.g. special values which cause short collisions).\n\n-- \n2.48.0.rc1.245.gb3e6e7acbc.dirty\n\n"},{"id":"509956","messageId":"20250106-pks-remote-branches-deprecation-v2-2-2ce87c053536@pks.im","threadId":"62625","inReplyTo":"20250106-pks-remote-branches-deprecation-v2-0-2ce87c053536@pks.im","subject":"[PATCH v2 2/5] ci: merge linux-gcc-default into linux-gcc","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-06T07:51:34Z","receivedAt":"2025-01-06T07:51:41Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The \"linux-gcc-default\" job is mostly doing the same as the \"linux-gcc\"\njob, except for a couple of minor differences:\n\n  - We use an explicit GCC version instead of the default version\n    provided by the distribution. We have other jobs that test with\n    \"gcc-8\", making this distinction pointless.\n\n  - We don't set up the Python version explicitly, and instead use the\n    default Python version. Python 2 has been end-of-life for quite a\n    while now though, making this distinction less interesting.\n\n  - We set up the default branch name to be \"main\" in \"linux-gcc\". We\n    have other testcases that don't and also some that explicitly use\n    \"master\".\n\nSo overall, the job does not add much to our test coverage. Merge it\ninto our \"linux-gcc\" job to reduce our test matrix a bit.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n .github/workflows/main.yml | 4 ----\n .gitlab-ci.yml             | 4 ----\n ci/lib.sh                  | 5 -----\n 3 files changed, 13 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 808ddc19b8a799abc414c6d6ba078a6e5be6bdfb..32d35d2257812f02121b20c3cae342d626481553 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -271,7 +271,6 @@ jobs:\n             pool: ubuntu-latest\n           - jobname: linux-gcc\n             cc: gcc\n-            cc_package: gcc-8\n             pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\n             cc: gcc\n@@ -286,9 +285,6 @@ jobs:\n           - jobname: osx-gcc\n             cc: gcc-13\n             pool: macos-13\n-          - jobname: linux-gcc-default\n-            cc: gcc\n-            pool: ubuntu-latest\n           - jobname: linux-leaks\n             cc: gcc\n             pool: ubuntu-latest\ndiff --git a/.gitlab-ci.yml b/.gitlab-ci.yml\nindex a1bc92893f27d6dd404133686b71c8061e55618c..b86bb0bdb3363e06e6fe4195c34babd67cf7e8cc 100644\n--- a/.gitlab-ci.yml\n+++ b/.gitlab-ci.yml\n@@ -46,14 +46,10 @@ test:linux:\n       - jobname: linux-gcc\n         image: ubuntu:20.04\n         CC: gcc\n-        CC_PACKAGE: gcc-8\n       - jobname: linux-TEST-vars\n         image: ubuntu:20.04\n         CC: gcc\n         CC_PACKAGE: gcc-8\n-      - jobname: linux-gcc-default\n-        image: ubuntu:latest\n-        CC: gcc\n       - jobname: linux-leaks\n         image: ubuntu:latest\n         CC: gcc\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 930f98d7228166c37c236beb062b14675fb68ef3..e67c481d4fe08d0ebc3253a7a832a96f65c79ffe 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -328,11 +328,6 @@ export SKIP_DASHED_BUILT_INS=YesPlease\n \n case \"$distro\" in\n ubuntu-*)\n-\tif test \"$jobname\" = \"linux-gcc-default\"\n-\tthen\n-\t\tbreak\n-\tfi\n-\n \t# Python 2 is end of life, and Ubuntu 23.04 and newer don't actually\n \t# have it anymore. We thus only test with Python 2 on older LTS\n \t# releases.\n\n-- \n2.48.0.rc1.245.gb3e6e7acbc.dirty\n\n"},{"id":"509957","messageId":"20250106-pks-remote-branches-deprecation-v2-3-2ce87c053536@pks.im","threadId":"62625","inReplyTo":"20250106-pks-remote-branches-deprecation-v2-0-2ce87c053536@pks.im","subject":"[PATCH v2 3/5] ci: repurpose \"linux-gcc\" job for deprecations","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-06T07:51:35Z","receivedAt":"2025-01-06T07:51:42Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The \"linux-gcc\" job isn't all that interesting by itself and can be\nconsidered more or less the \"standard\" job: it is running with a\nreasonably up-to-date image and uses GCC as a compiler, both of which we\nalready cover in other jobs.\n\nThere is one exception though: we change the default branch to be \"main\"\ninstead of \"master\", so it is forging ahead a bit into the future to\nmake sure that this change does not cause havoc. So let's expand on this\na bit and also add the new \"WITH_BREAKING_CHANGES\" flag to the mix.\n\nRename the job to \"linux-breaking-changes\" accordingly.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n .github/workflows/main.yml | 2 +-\n .gitlab-ci.yml             | 2 +-\n ci/run-build-and-tests.sh  | 3 ++-\n 3 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 32d35d2257812f02121b20c3cae342d626481553..46b96fb96cc6e2659fe0b4b640f7e671587d059a 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -269,7 +269,7 @@ jobs:\n           - jobname: linux-reftable\n             cc: clang\n             pool: ubuntu-latest\n-          - jobname: linux-gcc\n+          - jobname: linux-breaking-changes\n             cc: gcc\n             pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\ndiff --git a/.gitlab-ci.yml b/.gitlab-ci.yml\nindex b86bb0bdb3363e06e6fe4195c34babd67cf7e8cc..492e5d9082dbdb3389c173f2b5a45fe43f4bea41 100644\n--- a/.gitlab-ci.yml\n+++ b/.gitlab-ci.yml\n@@ -43,7 +43,7 @@ test:linux:\n       - jobname: linux-reftable\n         image: ubuntu:latest\n         CC: clang\n-      - jobname: linux-gcc\n+      - jobname: linux-breaking-changes\n         image: ubuntu:20.04\n         CC: gcc\n       - jobname: linux-TEST-vars\ndiff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh\nindex 2e28d02b20f2469afddc4e04fdbd18465babb1ef..2ccd812fb4e025be3b8e9ab2ec6ae44e92944ab0 100755\n--- a/ci/run-build-and-tests.sh\n+++ b/ci/run-build-and-tests.sh\n@@ -13,8 +13,9 @@ esac\n run_tests=t\n \n case \"$jobname\" in\n-linux-gcc)\n+linux-breaking-changes)\n \texport GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n+\texport WITH_BREAKING_CHANGES=YesPlease\n \t;;\n linux-TEST-vars)\n \texport GIT_TEST_SPLIT_INDEX=yes\n\n-- \n2.48.0.rc1.245.gb3e6e7acbc.dirty\n\n"},{"id":"509958","messageId":"20250106-pks-remote-branches-deprecation-v2-4-2ce87c053536@pks.im","threadId":"62625","inReplyTo":"20250106-pks-remote-branches-deprecation-v2-0-2ce87c053536@pks.im","subject":"[PATCH v2 4/5] builtin/pack-redundant: remove subcommand with breaking changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-06T07:51:36Z","receivedAt":"2025-01-06T07:51:43Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The git-pack-redundant(1) subcommand has been announced for removal with\n53a92c9552 (Documentation/BreakingChanges: announce removal of\ngit-pack-redundant(1), 2024-09-02). Stop compiling the subcommand in\ncase the `WITH_BREAKING_CHANGES` build flag is set.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Makefile                  | 2 ++\n git.c                     | 2 ++\n t/t5323-pack-redundant.sh | 6 ++++++\n 3 files changed, 10 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex dc3c980aa7a4f42d27ed72415a636ac82b2a5684..e6b0d859803ac4d53079ec2a39143441a5662203 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1278,7 +1278,9 @@ BUILTIN_OBJS += builtin/mv.o\n BUILTIN_OBJS += builtin/name-rev.o\n BUILTIN_OBJS += builtin/notes.o\n BUILTIN_OBJS += builtin/pack-objects.o\n+ifndef WITH_BREAKING_CHANGES\n BUILTIN_OBJS += builtin/pack-redundant.o\n+endif\n BUILTIN_OBJS += builtin/pack-refs.o\n BUILTIN_OBJS += builtin/patch-id.o\n BUILTIN_OBJS += builtin/prune-packed.o\ndiff --git a/git.c b/git.c\nindex 46b3c740c5d665388917c6eee3052cc3ef8368f2..a13c32bcdc694460fcafe8079d3aa6e8caea1b4c 100644\n--- a/git.c\n+++ b/git.c\n@@ -589,7 +589,9 @@ static struct cmd_struct commands[] = {\n \t{ \"name-rev\", cmd_name_rev, RUN_SETUP },\n \t{ \"notes\", cmd_notes, RUN_SETUP },\n \t{ \"pack-objects\", cmd_pack_objects, RUN_SETUP },\n+#ifndef WITH_BREAKING_CHANGES\n \t{ \"pack-redundant\", cmd_pack_redundant, RUN_SETUP | NO_PARSEOPT },\n+#endif\n \t{ \"pack-refs\", cmd_pack_refs, RUN_SETUP },\n \t{ \"patch-id\", cmd_patch_id, RUN_SETUP_GENTLY | NO_PARSEOPT },\n \t{ \"pickaxe\", cmd_blame, RUN_SETUP },\ndiff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh\nindex 8dbbcc5e51c06d7c5f56fcb3107860fcb66a5106..688cd9706c876a7edcaf0bcd642ae08ece188d4d 100755\n--- a/t/t5323-pack-redundant.sh\n+++ b/t/t5323-pack-redundant.sh\n@@ -36,6 +36,12 @@ relationship between packs and objects is as follows:\n \n . ./test-lib.sh\n \n+if ! test_have_prereq WITHOUT_BREAKING_CHANGES\n+then\n+\tskip_all='skipping git-pack-redundant tests; built with breaking changes'\n+\ttest_done\n+fi\n+\n main_repo=main.git\n shared_repo=shared.git\n \n\n-- \n2.48.0.rc1.245.gb3e6e7acbc.dirty\n\n"},{"id":"509959","messageId":"20250106-pks-remote-branches-deprecation-v2-5-2ce87c053536@pks.im","threadId":"62625","inReplyTo":"20250106-pks-remote-branches-deprecation-v2-0-2ce87c053536@pks.im","subject":"[PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-06T07:51:37Z","receivedAt":"2025-01-06T07:51:44Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Back when Git was in its infancy, remotes were configured via separate\nfiles in \"branches/\" (back in 2005). This mechanism was replaced later\nthat year with the \"remotes/\" directory. These mechanism have eventually\nbeen replaced by config-based remotes, and it is very unlikely that\nanybody still uses these directories to configure their remotes.\n\nBoth of these directories have been marked as deprecated, one in 2005\nand the other one in 2011. Follow through with the deprecation and\nfinally announce the removal of these features in Git 3.0.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/BreakingChanges.txt      | 25 ++++++++++++++++++\n Documentation/gitrepository-layout.txt |  7 +++--\n builtin/remote.c                       |  2 ++\n remote.c                               |  6 +++++\n remote.h                               |  2 ++\n t/t5505-remote.sh                      |  6 ++---\n t/t5510-fetch.sh                       | 13 ++++------\n t/t5515-fetch-merge-logic.sh           | 47 ++++++++++++++++++----------------\n t/t5516-fetch-push.sh                  | 14 +++++-----\n 9 files changed, 79 insertions(+), 43 deletions(-)\n\ndiff --git a/Documentation/BreakingChanges.txt b/Documentation/BreakingChanges.txt\nindex 27acff86db4883a7d7967343c61711959b75a473..a91eb3bc5518d09b39c49ce07964ca3aba7b11dd 100644\n--- a/Documentation/BreakingChanges.txt\n+++ b/Documentation/BreakingChanges.txt\n@@ -154,6 +154,31 @@ Cf. <xmqq1rjuz6n3.fsf_-_@gitster.c.googlers.com>,\n     <CAKvOHKAFXQwt4D8yUCCkf_TQL79mYaJ=KAKhtpDNTvHJFuX1NA@mail.gmail.com>,\n     <20230323204047.GA9290@coredump.intra.peff.net>,\n \n+* Support for storing shorthands for remote URLs in \"$GIT_COMMON_DIR/branches/\"\n+  and \"$GIT_COMMON_DIR/remotes/\" has been long superseded by storing remotes in\n+  the repository configuration.\n++\n+The mechanism has originally been introduced in f170e4b39d ([PATCH] fetch/pull:\n+short-hand notation for remote repositories., 2005-07-16) and was superseded by\n+6687f8fea2 ([PATCH] Use .git/remote/origin, not .git/branches/origin.,\n+2005-08-20), where we switched from \".git/branches/\" to \".git/remotes/\". That\n+commit already mentions an upcoming deprecation of the \".git/branches/\"\n+directory, and starting with a1d4aa7424 (Add repository-layout document.,\n+2005-09-01) we have also marked this layout as deprecated. Eventually we also\n+started to migrate away from \".git/remotes/\" in favor of config-based remotes,\n+and we have marked the directory as legacy in 3d3d282146 (Documentation:\n+Grammar correction, wording fixes and cleanup, 2011-08-23)\n++\n+As our documentation mentions, these directories are not to be found in modern\n+repositories at all and most users aren't even aware of these mechanisms. They\n+have been deprecated for almost 20 years and 14 years respectively, and we are\n+not aware of any reason why anybody would want to use these mechanisms.\n+Furthermore, the \".git/branches/\" directory is nowadays misleadingly named and\n+may cause confusion as \"branches\" are almost exclusively used in the context of\n+references.\n++\n+These features will be removed.\n+\n == Superseded features that will not be deprecated\n \n Some features have gained newer replacements that aim to improve the design in\ndiff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt\nindex fa8b51daf08775f3d666a910d9b00486627e02af..85911ca8ea0b222ab9cc3dc2dd99c5136c72bd2b 100644\n--- a/Documentation/gitrepository-layout.txt\n+++ b/Documentation/gitrepository-layout.txt\n@@ -153,7 +153,7 @@ config.worktree::\n \tlinkgit:git-worktree[1]).\n \n branches::\n-\tA slightly deprecated way to store shorthands to be used\n+\tA deprecated way to store shorthands to be used\n \tto specify a URL to 'git fetch', 'git pull' and 'git push'.\n \tA file can be stored as `branches/<name>` and then\n \t'name' can be given to these commands in place of\n@@ -162,7 +162,8 @@ branches::\n \tand not likely to be found in modern repositories. This\n \tdirectory is ignored if $GIT_COMMON_DIR is set and\n \t\"$GIT_COMMON_DIR/branches\" will be used instead.\n-\n++\n+Git will stop reading remotes from this directory in Git 3.0.\n \n hooks::\n \tHooks are customization scripts used by various Git\n@@ -238,6 +239,8 @@ remotes::\n \tand not likely to be found in modern repositories. This\n \tdirectory is ignored if $GIT_COMMON_DIR is set and\n \t\"$GIT_COMMON_DIR/remotes\" will be used instead.\n++\n+Git will stop reading remotes from this directory in Git 3.0.\n \n logs::\n \tRecords of changes made to refs are stored in this directory.\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 1ad3e70a6b438a3c4446b16c02dc5c23c7fa14be..e565b2b3fec8bf2e4182e85d8d08953a14416881 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -640,10 +640,12 @@ static int migrate_file(struct remote *remote)\n \tstrbuf_addf(&buf, \"remote.%s.fetch\", remote->name);\n \tfor (i = 0; i < remote->fetch.nr; i++)\n \t\tgit_config_set_multivar(buf.buf, remote->fetch.items[i].raw, \"^$\", 0);\n+#ifndef WITH_BREAKING_CHANGES\n \tif (remote->origin == REMOTE_REMOTES)\n \t\tunlink_or_warn(git_path(\"remotes/%s\", remote->name));\n \telse if (remote->origin == REMOTE_BRANCHES)\n \t\tunlink_or_warn(git_path(\"branches/%s\", remote->name));\n+#endif /* WITH_BREAKING_CHANGES */\n \tstrbuf_release(&buf);\n \n \treturn 0;\ndiff --git a/remote.c b/remote.c\nindex 10104d11e3cba1908cd35f22b54e167755770404..55e91fab47197313fd8c2c1c5f73fcd46b4df4f7 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -293,6 +293,7 @@ static void add_instead_of(struct rewrite *rewrite, const char *instead_of)\n \trewrite->instead_of_nr++;\n }\n \n+#ifndef WITH_BREAKING_CHANGES\n static const char *skip_spaces(const char *s)\n {\n \twhile (isspace(*s))\n@@ -374,6 +375,7 @@ static void read_branches_file(struct remote_state *remote_state,\n \tstrbuf_release(&buf);\n \tfree(to_free);\n }\n+#endif /* WITH_BREAKING_CHANGES */\n \n static int handle_config(const char *key, const char *value,\n \t\t\t const struct config_context *ctx, void *cb)\n@@ -572,6 +574,7 @@ static void read_config(struct repository *repo, int early)\n \talias_all_urls(repo->remote_state);\n }\n \n+#ifndef WITH_BREAKING_CHANGES\n static int valid_remote_nick(const char *name)\n {\n \tif (!name[0] || is_dot_or_dotdot(name))\n@@ -583,6 +586,7 @@ static int valid_remote_nick(const char *name)\n \t\t\treturn 0;\n \treturn 1;\n }\n+#endif /* WITH_BREAKING_CHANGES */\n \n static const char *remotes_remote_for_branch(struct remote_state *remote_state,\n \t\t\t\t\t     struct branch *branch,\n@@ -725,12 +729,14 @@ remotes_remote_get_1(struct remote_state *remote_state, const char *name,\n \t\t\t\t   &name_given);\n \n \tret = make_remote(remote_state, name, 0);\n+#ifndef WITH_BREAKING_CHANGES\n \tif (valid_remote_nick(name) && have_git_dir()) {\n \t\tif (!valid_remote(ret))\n \t\t\tread_remotes_file(remote_state, ret);\n \t\tif (!valid_remote(ret))\n \t\t\tread_branches_file(remote_state, ret);\n \t}\n+#endif /* WITH_BREAKING_CHANGES */\n \tif (name_given && !valid_remote(ret))\n \t\tadd_url_alias(remote_state, ret, name);\n \tif (!valid_remote(ret))\ndiff --git a/remote.h b/remote.h\nindex a7e5c4e07c53ce5a0f6d852ce9f9233e6bb61550..45b0c9babb1374a05471e86de2c248972adb2aae 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -21,8 +21,10 @@ struct transport_ls_refs_options;\n enum {\n \tREMOTE_UNCONFIGURED = 0,\n \tREMOTE_CONFIG,\n+#ifndef WITH_BREAKING_CHANGES\n \tREMOTE_REMOTES,\n \tREMOTE_BRANCHES\n+#endif /* WITH_BREAKING_CHANGES */\n };\n \n struct rewrite {\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex 08424e878e104cc19a43960b987cf868f542cad2..e96ac8c7676ceeb7299c8f0839d9654d527ae084 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -1007,7 +1007,7 @@ Pull: refs/heads/main:refs/heads/origin\n Pull: refs/heads/next:refs/heads/origin2\n EOF\n \n-test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '\n \tgit clone one five &&\n \torigin_url=$(pwd)/one &&\n \t(\n@@ -1033,7 +1033,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \t)\n '\n \n-test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '\n \tgit clone --template= one six &&\n \torigin_url=$(pwd)/one &&\n \t(\n@@ -1049,7 +1049,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \t)\n '\n \n-test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '\n \tgit clone --template= one seven &&\n \t(\n \t\tcd seven &&\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 3b3991ab8678a57fce3ad371e37900fb3c6c426a..04d8a96367910d4687b18a8f725dc365cf2ceedb 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -34,14 +34,11 @@ test_expect_success \"clone and setup child repos\" '\n \tgit clone . three &&\n \t(\n \t\tcd three &&\n-\t\tgit config branch.main.remote two &&\n-\t\tgit config branch.main.merge refs/heads/one &&\n-\t\tmkdir -p .git/remotes &&\n-\t\tcat >.git/remotes/two <<-\\EOF\n-\t\tURL: ../two/.git/\n-\t\tPull: refs/heads/main:refs/heads/two\n-\t\tPull: refs/heads/one:refs/heads/one\n-\t\tEOF\n+\t\tgit config set remote.two.url ../two/.git/ &&\n+\t\tgit config set remote.two.fetch refs/heads/main:refs/heads/two &&\n+\t\tgit config set --append remote.two.fetch refs/heads/one:refs/heads/one &&\n+\t\tgit config set branch.main.remote two &&\n+\t\tgit config set branch.main.merge refs/heads/one\n \t) &&\n \tgit clone . bundle &&\n \tgit clone . seven\ndiff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh\nindex 320d26796d24d8a2281d37220a7bdf73cafaa503..4e6026c6114fb8367136173ea2b7fdbc0baa37fc 100755\n--- a/t/t5515-fetch-merge-logic.sh\n+++ b/t/t5515-fetch-merge-logic.sh\n@@ -104,28 +104,31 @@ test_expect_success setup '\n \tgit config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&\n \tremotes=\"$remotes config-glob\" &&\n \n-\tmkdir -p .git/remotes &&\n-\tcat >.git/remotes/remote-explicit <<-\\EOF &&\n-\tURL: ../.git/\n-\tPull: refs/heads/main:remotes/rem/main\n-\tPull: refs/heads/one:remotes/rem/one\n-\tPull: two:remotes/rem/two\n-\tPull: refs/heads/three:remotes/rem/three\n-\tEOF\n-\tremotes=\"$remotes remote-explicit\" &&\n-\n-\tcat >.git/remotes/remote-glob <<-\\EOF &&\n-\tURL: ../.git/\n-\tPull: refs/heads/*:refs/remotes/rem/*\n-\tEOF\n-\tremotes=\"$remotes remote-glob\" &&\n-\n-\tmkdir -p .git/branches &&\n-\techo \"../.git\" > .git/branches/branches-default &&\n-\tremotes=\"$remotes branches-default\" &&\n-\n-\techo \"../.git#one\" > .git/branches/branches-one &&\n-\tremotes=\"$remotes branches-one\" &&\n+\tif test_have_prereq WITHOUT_BREAKING_CHANGES\n+\tthen\n+\t\tmkdir -p .git/remotes &&\n+\t\tcat >.git/remotes/remote-explicit <<-\\EOF &&\n+\t\tURL: ../.git/\n+\t\tPull: refs/heads/main:remotes/rem/main\n+\t\tPull: refs/heads/one:remotes/rem/one\n+\t\tPull: two:remotes/rem/two\n+\t\tPull: refs/heads/three:remotes/rem/three\n+\t\tEOF\n+\t\tremotes=\"$remotes remote-explicit\" &&\n+\n+\t\tcat >.git/remotes/remote-glob <<-\\EOF &&\n+\t\tURL: ../.git/\n+\t\tPull: refs/heads/*:refs/remotes/rem/*\n+\t\tEOF\n+\t\tremotes=\"$remotes remote-glob\" &&\n+\n+\t\tmkdir -p .git/branches &&\n+\t\techo \"../.git\" > .git/branches/branches-default &&\n+\t\tremotes=\"$remotes branches-default\" &&\n+\n+\t\techo \"../.git#one\" > .git/branches/branches-one &&\n+\t\tremotes=\"$remotes branches-one\"\n+\tfi &&\n \n \tfor remote in $remotes ; do\n \t\tgit config branch.br-$remote.remote $remote &&\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 9d693eb57f7790ddb81cee0b905a101719069562..e705aedbf4a8d57ed188918077b9f82ed8e77b51 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -975,7 +975,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' '\n \t! grep \"warning: updating the current branch\" stderr\n '\n \n-test_expect_success 'fetch with branches' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '\n \tmk_empty testrepo &&\n \tgit branch second $the_first_commit &&\n \tgit checkout second &&\n@@ -991,7 +991,7 @@ test_expect_success 'fetch with branches' '\n \tgit checkout main\n '\n \n-test_expect_success 'fetch with branches containing #' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #' '\n \tmk_empty testrepo &&\n \tmkdir testrepo/.git/branches &&\n \techo \"..#second\" > testrepo/.git/branches/branch2 &&\n@@ -1005,7 +1005,7 @@ test_expect_success 'fetch with branches containing #' '\n \tgit checkout main\n '\n \n-test_expect_success 'push with branches' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '\n \tmk_empty testrepo &&\n \tgit checkout second &&\n \n@@ -1022,7 +1022,7 @@ test_expect_success 'push with branches' '\n \t)\n '\n \n-test_expect_success 'push with branches containing #' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches containing #' '\n \tmk_empty testrepo &&\n \n \ttest_when_finished \"rm -rf .git/branches\" &&\n@@ -1211,18 +1211,16 @@ test_expect_success 'push --porcelain --dry-run rejected' '\n '\n \n test_expect_success 'push --prune' '\n-\tmk_test testrepo heads/main heads/second heads/foo heads/bar &&\n+\tmk_test testrepo heads/main heads/foo heads/bar &&\n \tgit push --prune testrepo : &&\n \tcheck_push_result testrepo $the_commit heads/main &&\n-\tcheck_push_result testrepo $the_first_commit heads/second &&\n \t! check_push_result testrepo $the_first_commit heads/foo heads/bar\n '\n \n test_expect_success 'push --prune refspec' '\n-\tmk_test testrepo tmp/main tmp/second tmp/foo tmp/bar &&\n+\tmk_test testrepo tmp/main tmp/foo tmp/bar &&\n \tgit push --prune testrepo \"refs/heads/*:refs/tmp/*\" &&\n \tcheck_push_result testrepo $the_commit tmp/main &&\n-\tcheck_push_result testrepo $the_first_commit tmp/second &&\n \t! check_push_result testrepo $the_first_commit tmp/foo tmp/bar\n '\n \n\n-- \n2.48.0.rc1.245.gb3e6e7acbc.dirty\n\n"},{"id":"509986","messageId":"CAP8UFD1wM29BFX7ndh905dX8aDF_vdG_azf9phnY+Cgutgfj_Q@mail.gmail.com","threadId":"62625","inReplyTo":"20250106-pks-remote-branches-deprecation-v2-1-2ce87c053536@pks.im","subject":"Re: [PATCH v2 1/5] Makefile: wire up build option for deprecated features","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-01-06T13:20:05Z","receivedAt":"2025-01-06T13:20:19Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Jan 6, 2025 at 8:51 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> With 57ec9254eb (docs: introduce document to announce breaking changes,\n> 2024-06-14), we have introduced a new document that tracks upcoming\n> breaking changes in the Git project. In 2454970930 (BreakingChanges:\n> early adopter option, 2024-10-11) we have amended the document a bit to\n> mention that any introduced breaking changes must be accompanied by\n> logic that allows us to enable the breaking change at compile-time.\n> While we already have two breaking changes lined up, neither of them has\n> such a switch because they predate those instructions.\n>\n> Introduce the proposed `WITH_BREAKING_CHANGES` preprocessor macro and\n> wire it up with both our Makefiles and Meson.\n\nIt's not clear from the above if the two already lined up breaking\nchanges are going to use the new build option in this patch, in a\nfollowing patch or in a future patch series after this one. Let's\nsee...\n\n[...]\n\n> diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\n> index 49904ca8a93981c514540bad5efa6833ddd14426..63d008892848c20d5937d9a624a480f700b19498 100644\n> --- a/contrib/buildsystems/CMakeLists.txt\n> +++ b/contrib/buildsystems/CMakeLists.txt\n> @@ -1198,6 +1198,7 @@ string(REPLACE \"@GITWEBDIR@\" \"'${GITWEBDIR}'\" git_build_options \"${git_build_opt\n>  string(REPLACE \"@USE_GETTEXT_SCHEME@\" \"\" git_build_options \"${git_build_options}\")\n>  string(REPLACE \"@LOCALEDIR@\" \"'${LOCALEDIR}'\" git_build_options \"${git_build_options}\")\n>  string(REPLACE \"@BROKEN_PATH_FIX@\" \"\" git_build_options \"${git_build_options}\")\n> +string(REPLACE \"@WITH_BREAKING_CHANGES@\" \"\" git_build_options \"${git_build_options}\")\n\nThe commit message says that the new build option is wired up with\nboth our Makefiles and Meson, so I didn't expect it to be also wired\nup with CMake, but it looks like it is.\n\n[...]\n\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 62dfcc4aaf959d0cf066d07663d939e14f92485c..6e423f655d35adf5a2d4f8b3a78d9e8c1119caab 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -1864,6 +1864,10 @@ test_lazy_prereq CURL '\n>         curl --version\n>  '\n>\n> +test_lazy_prereq WITHOUT_BREAKING_CHANGES '\n> +       test -z \"$WITH_BREAKING_CHANGES\"\n> +'\n\nNot expected from reading the commit message, but nice to have too.\n"},{"id":"509987","messageId":"CAP8UFD3c6Z55m=frXqWS1ffrOK2y-MO8E6vMXsv9q6eWkSYBjA@mail.gmail.com","threadId":"62625","inReplyTo":"CAP8UFD1wM29BFX7ndh905dX8aDF_vdG_azf9phnY+Cgutgfj_Q@mail.gmail.com","subject":"Re: [PATCH v2 1/5] Makefile: wire up build option for deprecated features","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-01-06T13:20:50Z","receivedAt":"2025-01-06T13:21:03Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Jan 6, 2025 at 12:18 PM Christian Couder\n<christian.couder@gmail.com> wrote:\n>\n> On Mon, Jan 6, 2025 at 8:51 AM Patrick Steinhardt <ps@pks.im> wrote:\n> >\n> > With 57ec9254eb (docs: introduce document to announce breaking changes,\n> > 2024-06-14), we have introduced a new document that tracks upcoming\n> > breaking changes in the Git project. In 2454970930 (BreakingChanges:\n> > early adopter option, 2024-10-11) we have amended the document a bit to\n> > mention that any introduced breaking changes must be accompanied by\n> > logic that allows us to enable the breaking change at compile-time.\n> > While we already have two breaking changes lined up, neither of them has\n> > such a switch because they predate those instructions.\n> >\n> > Introduce the proposed `WITH_BREAKING_CHANGES` preprocessor macro and\n> > wire it up with both our Makefiles and Meson.\n>\n> It's not clear from the above if the two already lined up breaking\n> changes are going to use the new build option in this patch, in a\n> following patch or in a future patch series after this one. Let's\n> see...\n\nIt looks like the two already lined up breaking changes are:\n\n  - removing pack-redundant which is handled in patch 4/5, and\n  - removing the \"branches/\" and \"remotes/\" directories which is\nhandled in patch 5/5.\n\nFine, but I think it would be better to be explicit about this.\n\nThanks.\n"},{"id":"509988","messageId":"CAP8UFD0Lzazxyq9nnT-vwN=MijKAsYySFC2dvDEj33cS7VB0kA@mail.gmail.com","threadId":"62625","inReplyTo":"20250106-pks-remote-branches-deprecation-v2-5-2ce87c053536@pks.im","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-01-06T13:24:30Z","receivedAt":"2025-01-06T13:24:43Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Jan 6, 2025 at 8:52 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> Back when Git was in its infancy, remotes were configured via separate\n> files in \"branches/\" (back in 2005). This mechanism was replaced later\n> that year with the \"remotes/\" directory. These mechanism have eventually\n\ns/mechanism/mechanisms/\n\n> been replaced by config-based remotes, and it is very unlikely that\n> anybody still uses these directories to configure their remotes.\n>\n> Both of these directories have been marked as deprecated, one in 2005\n> and the other one in 2011. Follow through with the deprecation and\n> finally announce the removal of these features in Git 3.0.\n\nWhat I like about the removal of git-pack-redundant(1) in the previous\npatch is that we started to emit a user-visible warning in 2020 and\nnow users even have to pass an `--i-still-use-this` option to be able\nto use the command. This really makes sure users cannot ignore the\nfact that the command is deprecated.\n\nAccordingly I think it would be nice if we started to emit warnings\n(that could possibly be disabled) when we find a repo still uses stuff\nin \"branches/\" and \"remotes/\". These would be much more difficult to\nmiss or ignore than doc changes.\n"},{"id":"509989","messageId":"CAP8UFD1ALC2f9iQady35MCdm18V3u9+b0iRhgx2Zd_UTeCY8vA@mail.gmail.com","threadId":"62625","inReplyTo":"20250106-pks-remote-branches-deprecation-v2-2-2ce87c053536@pks.im","subject":"Re: [PATCH v2 2/5] ci: merge linux-gcc-default into linux-gcc","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-01-06T13:25:23Z","receivedAt":"2025-01-06T13:25:37Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Jan 6, 2025 at 8:51 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> The \"linux-gcc-default\" job is mostly doing the same as the \"linux-gcc\"\n> job, except for a couple of minor differences:\n>\n>   - We use an explicit GCC version instead of the default version\n>     provided by the distribution. We have other jobs that test with\n>     \"gcc-8\", making this distinction pointless.\n>\n>   - We don't set up the Python version explicitly, and instead use the\n>     default Python version. Python 2 has been end-of-life for quite a\n>     while now though, making this distinction less interesting.\n>\n>   - We set up the default branch name to be \"main\" in \"linux-gcc\". We\n>     have other testcases that don't and also some that explicitly use\n>     \"master\".\n>\n> So overall, the job does not add much to our test coverage. Merge it\n> into our \"linux-gcc\" job to reduce our test matrix a bit.\n\nI understand that the subject uses \"merge\" as the space is limited\nthere, but it might be better to be a bit more explicit here about\nwhat the patch is doing, which is:\n\n  - making the \"linux-gcc\" job use the default version of gcc provided\nby the distribution (which is ubuntu-20.04) instead of \"gcc-8\",\n  - removing the \"linux-gcc-default\" job.\n\n\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n>  .github/workflows/main.yml | 4 ----\n>  .gitlab-ci.yml             | 4 ----\n>  ci/lib.sh                  | 5 -----\n>  3 files changed, 13 deletions(-)\n>\n> diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\n> index 808ddc19b8a799abc414c6d6ba078a6e5be6bdfb..32d35d2257812f02121b20c3cae342d626481553 100644\n> --- a/.github/workflows/main.yml\n> +++ b/.github/workflows/main.yml\n> @@ -271,7 +271,6 @@ jobs:\n>              pool: ubuntu-latest\n>            - jobname: linux-gcc\n>              cc: gcc\n> -            cc_package: gcc-8\n>              pool: ubuntu-20.04\n\nSo linux-gcc uses ubuntu-20.04...\n\n>            - jobname: linux-TEST-vars\n>              cc: gcc\n> @@ -286,9 +285,6 @@ jobs:\n>            - jobname: osx-gcc\n>              cc: gcc-13\n>              pool: macos-13\n> -          - jobname: linux-gcc-default\n> -            cc: gcc\n> -            pool: ubuntu-latest\n\n...while linux-gcc-default uses ubuntu-latest.\n\nThis is not a big issue but I didn't see that mentioned in the\ndifferences between the two jobs listed in the commit message.\n"},{"id":"509997","messageId":"xmqqbjwk0x0e.fsf@gitster.g","threadId":"62625","inReplyTo":"20250106-pks-remote-branches-deprecation-v2-0-2ce87c053536@pks.im","subject":"Re: [PATCH v2 0/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-06T15:42:25Z","receivedAt":"2025-01-06T15:42:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> back when Git was in its infancy, remotes were configured via separate\n> files in \"branches/\" (back in 2005). This mechanism was replaced later\n> that year with the \"remotes/\" directory. These mechanism have evenutally\n> been replaced by config-based remotes,...\n\nJust a historical note, as I am not sure how much of it still\nmatters.  In all of the above \"replaced\" is an incorrect verb to\nuse.  \"A more-powerful-but-different mechanism to do the same and\nmore was introduced later\" is a fair statement, though.\n\nSpecifically the \".git/branches/name\" mechanism was never removed as\nit had one distinct advantage over all other mechanisms for users\nwho have to juggle tons of remotes that change either their URLs or\nbranch names or both not so infrequently.  Instead of having to edit\nfiles in .git/remotes/*, being able to say\n\n\t$ ls .git/branches/*partialname*\n\t$ echo \"$URL#$branch\" >.git/branches/foo\n\t$ rm .git/brnaches/foo\n\nwas powerful.  Offhand I do not know if \"git remote\" command\nimproved the usability aspect of newer mechanisms good enough\nto allow us to start using the verb \"replace\" here.\n\n"},{"id":"509998","messageId":"xmqq7c780wlv.fsf@gitster.g","threadId":"62625","inReplyTo":"CAP8UFD1ALC2f9iQady35MCdm18V3u9+b0iRhgx2Zd_UTeCY8vA@mail.gmail.com","subject":"Re: [PATCH v2 2/5] ci: merge linux-gcc-default into linux-gcc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-06T15:51:08Z","receivedAt":"2025-01-06T15:51:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> On Mon, Jan 6, 2025 at 8:51 AM Patrick Steinhardt <ps@pks.im> wrote:\n>>\n>> The \"linux-gcc-default\" job is mostly doing the same as the \"linux-gcc\"\n>> job, except for a couple of minor differences:\n>>\n>>   - We use an explicit GCC version instead of the default version\n>>     provided by the distribution. We have other jobs that test with\n>>     \"gcc-8\", making this distinction pointless.\n>>\n>>   - We don't set up the Python version explicitly, and instead use the\n>>     default Python version. Python 2 has been end-of-life for quite a\n>>     while now though, making this distinction less interesting.\n>>\n>>   - We set up the default branch name to be \"main\" in \"linux-gcc\". We\n>>     have other testcases that don't and also some that explicitly use\n>>     \"master\".\n>>\n>> So overall, the job does not add much to our test coverage. Merge it\n>> into our \"linux-gcc\" job to reduce our test matrix a bit.\n>\n> I understand that the subject uses \"merge\" as the space is limited\n> there, but it might be better to be a bit more explicit here about\n> what the patch is doing, which is:\n>\n>   - making the \"linux-gcc\" job use the default version of gcc provided\n> by the distribution (which is ubuntu-20.04) instead of \"gcc-8\",\n>   - removing the \"linux-gcc-default\" job.\n\nunify?  deprecate (the 'default' one)?  \n\nFWIW, I do not think of a better way to phrase what the patch is\ndoing than \"merge X into Y\".\n\nThanks.\n"},{"id":"509999","messageId":"xmqq34hw0whh.fsf@gitster.g","threadId":"62625","inReplyTo":"CAP8UFD0Lzazxyq9nnT-vwN=MijKAsYySFC2dvDEj33cS7VB0kA@mail.gmail.com","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-06T15:53:46Z","receivedAt":"2025-01-06T15:53:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> What I like about the removal of git-pack-redundant(1) in the previous\n> patch is that we started to emit a user-visible warning in 2020 and\n> now users even have to pass an `--i-still-use-this` option to be able\n> to use the command. This really makes sure users cannot ignore the\n> fact that the command is deprecated.\n>\n> Accordingly I think it would be nice if we started to emit warnings\n> (that could possibly be disabled) when we find a repo still uses stuff\n> in \"branches/\" and \"remotes/\". These would be much more difficult to\n> miss or ignore than doc changes.\n\nThat's an excellent suggestion.  Even though this topic is about\nintroducing breaking changes, saying \"we waited for long enough\",\nmaking sure we have prepared the user base for such changes to\nlesson the impact of \"breaking\" changes is a very prudent thing to\ndo.\n\nI guess everything is contained within remote.c these days?\nPatches welcome ;-)\n\nThanks.\n"},{"id":"510076","messageId":"Z30ik6NlYVMnNMpB@pks.im","threadId":"62625","inReplyTo":"xmqqbjwk0x0e.fsf@gitster.g","subject":"Re: [PATCH v2 0/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-07T12:48:19Z","receivedAt":"2025-01-07T12:48:23Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Jan 06, 2025 at 07:42:25AM -0800, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> > back when Git was in its infancy, remotes were configured via separate\n> > files in \"branches/\" (back in 2005). This mechanism was replaced later\n> > that year with the \"remotes/\" directory. These mechanism have evenutally\n> > been replaced by config-based remotes,...\n> \n> Just a historical note, as I am not sure how much of it still\n> matters.  In all of the above \"replaced\" is an incorrect verb to\n> use.  \"A more-powerful-but-different mechanism to do the same and\n> more was introduced later\" is a fair statement, though.\n> \n> Specifically the \".git/branches/name\" mechanism was never removed as\n> it had one distinct advantage over all other mechanisms for users\n> who have to juggle tons of remotes that change either their URLs or\n> branch names or both not so infrequently.  Instead of having to edit\n> files in .git/remotes/*, being able to say\n> \n> \t$ ls .git/branches/*partialname*\n> \t$ echo \"$URL#$branch\" >.git/branches/foo\n> \t$ rm .git/brnaches/foo\n> \n> was powerful.  Offhand I do not know if \"git remote\" command\n> improved the usability aspect of newer mechanisms good enough\n> to allow us to start using the verb \"replace\" here.\n\nI would claim the fact that nobody nowadays knows about either of the\nold mechanisms is a good indicator that git-remote(1) has indeed\ncompletely replaced them. I'm happy to slightly reword it though, even\nif it doesn't ultimately end up in any of the commits anyway :)\n\nPatrick\n"},{"id":"510077","messageId":"Z30ipNB88iyaWMBT@pks.im","threadId":"62625","inReplyTo":"CAP8UFD1ALC2f9iQady35MCdm18V3u9+b0iRhgx2Zd_UTeCY8vA@mail.gmail.com","subject":"Re: [PATCH v2 2/5] ci: merge linux-gcc-default into linux-gcc","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-07T12:48:36Z","receivedAt":"2025-01-07T12:48:40Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Jan 06, 2025 at 02:25:23PM +0100, Christian Couder wrote:\n> On Mon, Jan 6, 2025 at 8:51 AM Patrick Steinhardt <ps@pks.im> wrote:\n> >\n> > The \"linux-gcc-default\" job is mostly doing the same as the \"linux-gcc\"\n> > job, except for a couple of minor differences:\n> >\n> >   - We use an explicit GCC version instead of the default version\n> >     provided by the distribution. We have other jobs that test with\n> >     \"gcc-8\", making this distinction pointless.\n> >\n> >   - We don't set up the Python version explicitly, and instead use the\n> >     default Python version. Python 2 has been end-of-life for quite a\n> >     while now though, making this distinction less interesting.\n> >\n> >   - We set up the default branch name to be \"main\" in \"linux-gcc\". We\n> >     have other testcases that don't and also some that explicitly use\n> >     \"master\".\n> >\n> > So overall, the job does not add much to our test coverage. Merge it\n> > into our \"linux-gcc\" job to reduce our test matrix a bit.\n> \n> I understand that the subject uses \"merge\" as the space is limited\n> there, but it might be better to be a bit more explicit here about\n> what the patch is doing, which is:\n> \n>   - making the \"linux-gcc\" job use the default version of gcc provided\n> by the distribution (which is ubuntu-20.04) instead of \"gcc-8\",\n>   - removing the \"linux-gcc-default\" job.\n\nBut isn't that what \"merging\" is about? One merges the diff of side A\ninto B and then removes A. I don't have an idea for a better subject,\nhonestly.\n\n> > Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> > ---\n> >  .github/workflows/main.yml | 4 ----\n> >  .gitlab-ci.yml             | 4 ----\n> >  ci/lib.sh                  | 5 -----\n> >  3 files changed, 13 deletions(-)\n> >\n> > diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\n> > index 808ddc19b8a799abc414c6d6ba078a6e5be6bdfb..32d35d2257812f02121b20c3cae342d626481553 100644\n> > --- a/.github/workflows/main.yml\n> > +++ b/.github/workflows/main.yml\n> > @@ -271,7 +271,6 @@ jobs:\n> >              pool: ubuntu-latest\n> >            - jobname: linux-gcc\n> >              cc: gcc\n> > -            cc_package: gcc-8\n> >              pool: ubuntu-20.04\n> \n> So linux-gcc uses ubuntu-20.04...\n> \n> >            - jobname: linux-TEST-vars\n> >              cc: gcc\n> > @@ -286,9 +285,6 @@ jobs:\n> >            - jobname: osx-gcc\n> >              cc: gcc-13\n> >              pool: macos-13\n> > -          - jobname: linux-gcc-default\n> > -            cc: gcc\n> > -            pool: ubuntu-latest\n> \n> ...while linux-gcc-default uses ubuntu-latest.\n> \n> This is not a big issue but I didn't see that mentioned in the\n> differences between the two jobs listed in the commit message.\n\nFair, added now.\n\nPatrick\n"},{"id":"510078","messageId":"Z30hnx43mEwjWqzA@pks.im","threadId":"62625","inReplyTo":"xmqq34hw0whh.fsf@gitster.g","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-07T12:48:42Z","receivedAt":"2025-01-07T12:48:45Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Jan 06, 2025 at 07:53:46AM -0800, Junio C Hamano wrote:\n> Christian Couder <christian.couder@gmail.com> writes:\n> \n> > What I like about the removal of git-pack-redundant(1) in the previous\n> > patch is that we started to emit a user-visible warning in 2020 and\n> > now users even have to pass an `--i-still-use-this` option to be able\n> > to use the command. This really makes sure users cannot ignore the\n> > fact that the command is deprecated.\n> >\n> > Accordingly I think it would be nice if we started to emit warnings\n> > (that could possibly be disabled) when we find a repo still uses stuff\n> > in \"branches/\" and \"remotes/\". These would be much more difficult to\n> > miss or ignore than doc changes.\n> \n> That's an excellent suggestion.  Even though this topic is about\n> introducing breaking changes, saying \"we waited for long enough\",\n> making sure we have prepared the user base for such changes to\n> lesson the impact of \"breaking\" changes is a very prudent thing to\n> do.\n> \n> I guess everything is contained within remote.c these days?\n> Patches welcome ;-)\n\nMakes sense indeed. We can easily add for something like below diff.\nI'll roll that into the next version, thanks!\n\nPatrick\n\ndiff --git a/remote.c b/remote.c\nindex 55e91fab47..8c104c6ee1 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -309,6 +309,13 @@ static void read_remotes_file(struct remote_state *remote_state,\n \n \tif (!f)\n \t\treturn;\n+\n+\twarning(_(\"Reading remote from \\\"remotes/%s\\\", which is nominated\\n\"\n+\t\t  \"for removal. If you still use the \\\"remotes/\\\" directory\\n\"\n+\t\t  \"it is recommended to migrate to config-based remotes. If\\n\"\n+\t\t  \"you cannot, please let us know you still use it by sending\\n\"\n+\t\t  \"an e-mail to <git@vger.kernel.org>.\"), remote->name);\n+\n \tremote->configured_in_repo = 1;\n \tremote->origin = REMOTE_REMOTES;\n \twhile (strbuf_getline(&buf, f) != EOF) {\n@@ -338,6 +345,12 @@ static void read_branches_file(struct remote_state *remote_state,\n \tif (!f)\n \t\treturn;\n \n+\twarning(_(\"Reading remote from \\\"branches/%s\\\", which is nominated\\n\"\n+\t\t  \"for removal. If you still use the \\\"branches/\\\" directory\\n\"\n+\t\t  \"it is recommended to migrate to config-based remotes. If\\n\"\n+\t\t  \"you cannot, please let us know you still use it by sending\\n\"\n+\t\t  \"an e-mail to <git@vger.kernel.org>.\"), remote->name);\n+\n \tstrbuf_getline_lf(&buf, f);\n \tfclose(f);\n \tstrbuf_trim(&buf);\n\n"},{"id":"510080","messageId":"CAP8UFD2MLfHVhz85sEJwJqhd-hFPUOm8b9eBSbjTgV=k966Tjw@mail.gmail.com","threadId":"62625","inReplyTo":"Z30ipNB88iyaWMBT@pks.im","subject":"Re: [PATCH v2 2/5] ci: merge linux-gcc-default into linux-gcc","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-01-07T13:54:33Z","receivedAt":"2025-01-07T13:54:47Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Jan 7, 2025 at 1:48 PM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Mon, Jan 06, 2025 at 02:25:23PM +0100, Christian Couder wrote:\n> > On Mon, Jan 6, 2025 at 8:51 AM Patrick Steinhardt <ps@pks.im> wrote:\n> > >\n> > > The \"linux-gcc-default\" job is mostly doing the same as the \"linux-gcc\"\n> > > job, except for a couple of minor differences:\n> > >\n> > >   - We use an explicit GCC version instead of the default version\n> > >     provided by the distribution. We have other jobs that test with\n> > >     \"gcc-8\", making this distinction pointless.\n> > >\n> > >   - We don't set up the Python version explicitly, and instead use the\n> > >     default Python version. Python 2 has been end-of-life for quite a\n> > >     while now though, making this distinction less interesting.\n> > >\n> > >   - We set up the default branch name to be \"main\" in \"linux-gcc\". We\n> > >     have other testcases that don't and also some that explicitly use\n> > >     \"master\".\n> > >\n> > > So overall, the job does not add much to our test coverage. Merge it\n> > > into our \"linux-gcc\" job to reduce our test matrix a bit.\n> >\n> > I understand that the subject uses \"merge\" as the space is limited\n> > there, but it might be better to be a bit more explicit here about\n> > what the patch is doing, which is:\n> >\n> >   - making the \"linux-gcc\" job use the default version of gcc provided\n> > by the distribution (which is ubuntu-20.04) instead of \"gcc-8\",\n> >   - removing the \"linux-gcc-default\" job.\n>\n> But isn't that what \"merging\" is about? One merges the diff of side A\n> into B and then removes A. I don't have an idea for a better subject,\n> honestly.\n\nMy comment was saying that it was fine to use \"merge\" in the subject,\nbut that, in the body part of the commit message, it would be better\nif there were more details about what the commit is actually doing.\n\nWhen the commit message is not clear about what the commit does, it's\ndifficult to check that the changes in the commit were intended.\n"},{"id":"510096","messageId":"xmqqcygyvavo.fsf@gitster.g","threadId":"62625","inReplyTo":"Z30ik6NlYVMnNMpB@pks.im","subject":"Re: [PATCH v2 0/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-07T16:36:59Z","receivedAt":"2025-01-07T16:37:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n>> Specifically the \".git/branches/name\" mechanism was never removed as\n>> it had one distinct advantage over all other mechanisms for users\n>> who have to juggle tons of remotes that change either their URLs or\n>> branch names or both not so infrequently.  Instead of having to edit\n>> files in .git/remotes/*, being able to say\n>> \n>> \t$ ls .git/branches/*partialname*\n>> \t$ echo \"$URL#$branch\" >.git/branches/foo\n>> \t$ rm .git/brnaches/foo\n>> \n>> was powerful.  Offhand I do not know if \"git remote\" command\n>> improved the usability aspect of newer mechanisms good enough\n>> to allow us to start using the verb \"replace\" here.\n>\n> I would claim the fact that nobody nowadays knows about either of the\n> old mechanisms is a good indicator that git-remote(1) has indeed\n> completely replaced them. I'm happy to slightly reword it though, even\n> if it doesn't ultimately end up in any of the commits anyway :)\n\nWe can claim whatever, but scripts written in ancient days may still\nknow about them and they do not care what we claim.  And that is the\nprimary thing that makes me worried.\n\nAs suggested elsewhere, I think it is prudent to add some checks\nwhen remote.c notices that we used the values that were read via\nthese old mechanims and complain loudly.\n\nThanks.\n"},{"id":"510097","messageId":"xmqq8qrmvap5.fsf@gitster.g","threadId":"62625","inReplyTo":"Z30hnx43mEwjWqzA@pks.im","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-07T16:40:54Z","receivedAt":"2025-01-07T16:40:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> Makes sense indeed. We can easily add for something like below diff.\n> I'll roll that into the next version, thanks!\n\nIt is a good start, but is probably a bit too noisy.  Can we make\nthem appear ONLY when the definitions read from these older sources\nare actually USED?\n\nThanks.\n\n>\n> Patrick\n>\n> diff --git a/remote.c b/remote.c\n> index 55e91fab47..8c104c6ee1 100644\n> --- a/remote.c\n> +++ b/remote.c\n> @@ -309,6 +309,13 @@ static void read_remotes_file(struct remote_state *remote_state,\n>  \n>  \tif (!f)\n>  \t\treturn;\n> +\n> +\twarning(_(\"Reading remote from \\\"remotes/%s\\\", which is nominated\\n\"\n> +\t\t  \"for removal. If you still use the \\\"remotes/\\\" directory\\n\"\n> +\t\t  \"it is recommended to migrate to config-based remotes. If\\n\"\n> +\t\t  \"you cannot, please let us know you still use it by sending\\n\"\n> +\t\t  \"an e-mail to <git@vger.kernel.org>.\"), remote->name);\n> +\n>  \tremote->configured_in_repo = 1;\n>  \tremote->origin = REMOTE_REMOTES;\n>  \twhile (strbuf_getline(&buf, f) != EOF) {\n> @@ -338,6 +345,12 @@ static void read_branches_file(struct remote_state *remote_state,\n>  \tif (!f)\n>  \t\treturn;\n>  \n> +\twarning(_(\"Reading remote from \\\"branches/%s\\\", which is nominated\\n\"\n> +\t\t  \"for removal. If you still use the \\\"branches/\\\" directory\\n\"\n> +\t\t  \"it is recommended to migrate to config-based remotes. If\\n\"\n> +\t\t  \"you cannot, please let us know you still use it by sending\\n\"\n> +\t\t  \"an e-mail to <git@vger.kernel.org>.\"), remote->name);\n> +\n>  \tstrbuf_getline_lf(&buf, f);\n>  \tfclose(f);\n>  \tstrbuf_trim(&buf);\n"},{"id":"510098","messageId":"xmqq4j2avaam.fsf@gitster.g","threadId":"62625","inReplyTo":"xmqq8qrmvap5.fsf@gitster.g","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-07T16:49:37Z","receivedAt":"2025-01-07T16:49:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Patrick Steinhardt <ps@pks.im> writes:\n>\n>> Makes sense indeed. We can easily add for something like below diff.\n>> I'll roll that into the next version, thanks!\n>\n> It is a good start, but is probably a bit too noisy.  Can we make\n> them appear ONLY when the definitions read from these older sources\n> are actually USED?\n>\n> Thanks.\n\nSomething along this line is what I had in mind.  Not even compile\ntested, and I am not claiming that all the uses of remote will go\nthourgh the code paths to use it with a transport, but you hopefully\ngot the idea.\n\n remote.c    | 20 ++++++++++++++++++++\n remote.h    |  2 ++\n transport.c |  2 ++\n 3 files changed, 24 insertions(+)\n\ndiff --git c/remote.c w/remote.c\nindex f43cf5e7a4..1cca98215d 100644\n--- c/remote.c\n+++ w/remote.c\n@@ -2904,3 +2904,23 @@ char *relative_url(const char *remote_url, const char *url,\n \tfree(out);\n \treturn strbuf_detach(&sb, NULL);\n }\n+\n+void remote_stale_warning(const struct remote *remote)\n+{\n+\tconst char *msg;\n+\n+\tswitch (remote->origin) {\n+\tcase REMOTE_REMOTES:\n+\t\tmsg = N_(\"Using remote '%s' read from the .git/remotes, \"\n+\t\t\t \"whose support will be removed\");\n+\t\tbreak;\n+\tcase REMOTE_BRANCHES:\n+\t\tmsg = N_(\"Using remote '%s' read from the .git/branches, \"\n+\t\t\t \"whose support will be removed\");\n+\t\tbreak;\n+\tdefault:\n+\t\treturn;\n+\t}\n+\n+\twarning(_(msg), remote->name);\n+}\ndiff --git c/remote.h w/remote.h\nindex b901b56746..e29ceef3e4 100644\n--- c/remote.h\n+++ w/remote.h\n@@ -445,4 +445,6 @@ 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+void remote_stale_warning(const struct remote *remote);\n+\n #endif\ndiff --git c/transport.c w/transport.c\nindex 12cc5b4d96..c153be9100 100644\n--- c/transport.c\n+++ w/transport.c\n@@ -1131,6 +1131,8 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \tret->remote = remote;\n \thelper = remote->foreign_vcs;\n \n+\tremote_stale_warning(remote);\n+\n \tif (!url)\n \t\turl = remote->url.v[0];\n \tret->url = url;\n"},{"id":"510099","messageId":"006701db6124$f16f9420$d44ebc60$@nexbridge.com","threadId":"62625","inReplyTo":"xmqq4j2avaam.fsf@gitster.g","subject":"RE: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-01-07T16:55:16Z","receivedAt":"2025-01-07T16:55:27Z","isPatch":true,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 7, 2025 11:50 AM, Junio C Hamano wrote:\n>Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Patrick Steinhardt <ps@pks.im> writes:\n>>\n>>> Makes sense indeed. We can easily add for something like below diff.\n>>> I'll roll that into the next version, thanks!\n>>\n>> It is a good start, but is probably a bit too noisy.  Can we make them\n>> appear ONLY when the definitions read from these older sources are\n>> actually USED?\n>>\n>> Thanks.\n>\n>Something along this line is what I had in mind.  Not even compile tested,\nand I am\n>not claiming that all the uses of remote will go thourgh the code paths to\nuse it with\n>a transport, but you hopefully got the idea.\n>\n> remote.c    | 20 ++++++++++++++++++++\n> remote.h    |  2 ++\n> transport.c |  2 ++\n> 3 files changed, 24 insertions(+)\n>\n>diff --git c/remote.c w/remote.c\n>index f43cf5e7a4..1cca98215d 100644\n>--- c/remote.c\n>+++ w/remote.c\n>@@ -2904,3 +2904,23 @@ char *relative_url(const char *remote_url, const\nchar\n>*url,\n> \tfree(out);\n> \treturn strbuf_detach(&sb, NULL);\n> }\n>+\n>+void remote_stale_warning(const struct remote *remote) {\n>+\tconst char *msg;\n>+\n>+\tswitch (remote->origin) {\n>+\tcase REMOTE_REMOTES:\n>+\t\tmsg = N_(\"Using remote '%s' read from the .git/remotes, \"\n>+\t\t\t \"whose support will be removed\");\n>+\t\tbreak;\n>+\tcase REMOTE_BRANCHES:\n>+\t\tmsg = N_(\"Using remote '%s' read from the .git/branches, \"\n>+\t\t\t \"whose support will be removed\");\n>+\t\tbreak;\n>+\tdefault:\n>+\t\treturn;\n>+\t}\n>+\n>+\twarning(_(msg), remote->name);\n>+}\n>diff --git c/remote.h w/remote.h\n>index b901b56746..e29ceef3e4 100644\n>--- c/remote.h\n>+++ w/remote.h\n>@@ -445,4 +445,6 @@ void apply_push_cas(struct push_cas_option *, struct\n>remote *, struct ref *);  char *relative_url(const char *remote_url, const\nchar *url,\n> \t\t   const char *up_path);\n>\n>+void remote_stale_warning(const struct remote *remote);\n>+\n> #endif\n>diff --git c/transport.c w/transport.c\n>index 12cc5b4d96..c153be9100 100644\n>--- c/transport.c\n>+++ w/transport.c\n>@@ -1131,6 +1131,8 @@ struct transport *transport_get(struct remote\n*remote,\n>const char *url)\n> \tret->remote = remote;\n> \thelper = remote->foreign_vcs;\n>\n>+\tremote_stale_warning(remote);\n>+\n> \tif (!url)\n> \t\turl = remote->url.v[0];\n> \tret->url = url;\n\nI like this but wonder whether there might be some way to inhibit the\nwarnings\none a user gets it and decides they will act but do not want to see the\nwarnings\nany longer? I have had requests like this on other products. Just a thought.\n\n"},{"id":"510146","messageId":"Z34c3rj0E6hP_kHN@pks.im","threadId":"62625","inReplyTo":"006701db6124$f16f9420$d44ebc60$@nexbridge.com","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-08T06:36:14Z","receivedAt":"2025-01-08T06:36:18Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Jan 07, 2025 at 11:55:16AM -0500, rsbecker@nexbridge.com wrote:\n> On January 7, 2025 11:50 AM, Junio C Hamano wrote:\n> >Junio C Hamano <gitster@pobox.com> writes:\n> >\n> >> Patrick Steinhardt <ps@pks.im> writes:\n> >>\n> >>> Makes sense indeed. We can easily add for something like below diff.\n> >>> I'll roll that into the next version, thanks!\n> >>\n> >> It is a good start, but is probably a bit too noisy.  Can we make them\n> >> appear ONLY when the definitions read from these older sources are\n> >> actually USED?\n> >>\n> >> Thanks.\n\nFair enough, can do.\n\n> I like this but wonder whether there might be some way to inhibit the\n> warnings one a user gets it and decides they will act but do not want\n> to see the warnings any longer? I have had requests like this on other\n> products. Just a thought.\n\nI guess the best idea I have here is to use an environment variable,\ne.g. \"GIT_ALLOW_DEPRECATED_REMOTES=true\", along with a hint for how to\nenable it.\n\nPatrick\n"},{"id":"510175","messageId":"xmqqwmf5mdvb.fsf@gitster.g","threadId":"62625","inReplyTo":"Z34c3rj0E6hP_kHN@pks.im","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-08T17:09:28Z","receivedAt":"2025-01-08T17:09:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> On Tue, Jan 07, 2025 at 11:55:16AM -0500, rsbecker@nexbridge.com wrote:\n>\n>> I like this but wonder whether there might be some way to inhibit the\n>> warnings one a user gets it and decides they will act but do not want\n>> to see the warnings any longer? I have had requests like this on other\n>> products. Just a thought.\n>\n> I guess the best idea I have here is to use an environment variable,\n> e.g. \"GIT_ALLOW_DEPRECATED_REMOTES=true\", along with a hint for how to\n> enable it.\n\nHmph.\n\nI may be missing something, but wouldn't the whole point of the\nwarning be noisy and pesky as long as the user _uses_ that\nconfiguration?  It is not like \"you can set this knob and delay the\nremoval past Git 3.0\".  If the user migrates away from the mechanism\nthat is being removed, we would stop bugging the user about the\nstale setting, so I do not see why we want to add anything extra\n(other than possibly telling them how to migrate away from\n$GIT_DIR/{branches,remotes}/ using \"git remote\" in the warning\nmessage itself).\n\nThanks.\n"},{"id":"510239","messageId":"Z3-fnHV3nOMa1EPZ@pks.im","threadId":"62625","inReplyTo":"xmqqwmf5mdvb.fsf@gitster.g","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-09T10:06:20Z","receivedAt":"2025-01-09T10:06:24Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Jan 08, 2025 at 09:09:28AM -0800, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> > On Tue, Jan 07, 2025 at 11:55:16AM -0500, rsbecker@nexbridge.com wrote:\n> >\n> >> I like this but wonder whether there might be some way to inhibit the\n> >> warnings one a user gets it and decides they will act but do not want\n> >> to see the warnings any longer? I have had requests like this on other\n> >> products. Just a thought.\n> >\n> > I guess the best idea I have here is to use an environment variable,\n> > e.g. \"GIT_ALLOW_DEPRECATED_REMOTES=true\", along with a hint for how to\n> > enable it.\n> \n> Hmph.\n> \n> I may be missing something, but wouldn't the whole point of the\n> warning be noisy and pesky as long as the user _uses_ that\n> configuration?  It is not like \"you can set this knob and delay the\n> removal past Git 3.0\".  If the user migrates away from the mechanism\n> that is being removed, we would stop bugging the user about the\n> stale setting, so I do not see why we want to add anything extra\n> (other than possibly telling them how to migrate away from\n> $GIT_DIR/{branches,remotes}/ using \"git remote\" in the warning\n> message itself).\n\nSure, that would be the intent. But it may take the user a bit of time\nto do the migration, and meanwhile they may want to silence the warning.\nIt's not like we'll release Git 3.0 tomorrow, it will probably take us a\nwhile to get there, which gives people a bit of time to migrate.\n\nI'm also happy to just leave it out though, I don't mind too much.\n\nPatrick\n"},{"id":"510240","messageId":"Z3-i5mB4JVeONy4O@pks.im","threadId":"62625","inReplyTo":"xmqq4j2avaam.fsf@gitster.g","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-09T10:20:29Z","receivedAt":"2025-01-09T10:20:34Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Jan 07, 2025 at 08:49:37AM -0800, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Patrick Steinhardt <ps@pks.im> writes:\n> >\n> >> Makes sense indeed. We can easily add for something like below diff.\n> >> I'll roll that into the next version, thanks!\n> >\n> > It is a good start, but is probably a bit too noisy.  Can we make\n> > them appear ONLY when the definitions read from these older sources\n> > are actually USED?\n> >\n> > Thanks.\n> \n> Something along this line is what I had in mind.  Not even compile\n> tested, and I am not claiming that all the uses of remote will go\n> thourgh the code paths to use it with a transport, but you hopefully\n> got the idea.\n\nI had a look at your idea now, but I'm not convinced that it would be a\nsignificantly improvement over my version. In almost all cases where we\nexecute `remote_get()` we'd also end up using the remote itself. So we'd\neither have to add the explicit warning to all such locations, or we\nrisk not warning in cases where we really should.\n\nThe result of `remote_get()` (and `remotes_remote_get()`) is also being\ncached, so if we retrieve the same remote multiple times from the same\nremote state we'd only see the warning once.\n\nSo I'm inclined to leave this as-is, maybe adding an escape hatch to\nsilence the warnings via an environment variable to give users a bit of\ntime to migrate.\n\nPatrick\n"},{"id":"510247","messageId":"CAFLLRpKk2qq3nZSz1XWotrt5W=6b6HfHevFQJ_UfMYbhOqRi1Q@mail.gmail.com","threadId":"62625","inReplyTo":"Z34c3rj0E6hP_kHN@pks.im","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Robert Coup","fromEmail":"robert.coup@koordinates.com","sentAt":"2025-01-09T12:08:20Z","receivedAt":"2025-01-09T12:08:36Z","isPatch":true,"sender":{"key":"robert.coup@koordinates.com","avatar":"https://gravatar.com/avatar/d1a87d63ffb562b791992d8a119ebbdd742e703109d23333ca3fca51306ee95c?d=mp&s=160"},"body":"Hi Patrick,\n\nOn Wed, 8 Jan 2025 at 06:36, Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Tue, Jan 07, 2025 at 11:55:16AM -0500, rsbecker@nexbridge.com wrote:\n>\n> > I like this but wonder whether there might be some way to inhibit the\n> > warnings one a user gets it and decides they will act but do not want\n> > to see the warnings any longer? I have had requests like this on other\n> > products. Just a thought.\n>\n> I guess the best idea I have here is to use an environment variable,\n> e.g. \"GIT_ALLOW_DEPRECATED_REMOTES=true\", along with a hint for how to\n> enable it.\n\nSince there will hopefully be several of these deprecated behaviours\nas 3.0 comes closer, rather than adding a tonne of variables should it\nbe a consistent method of silencing warnings? eg:\n\"GIT_IGNORE_DEPRECATION_WARNINGS=remotes:splines:llamas\".  And/or\nachieving it via config settings.\n\nRob :)\n"},{"id":"510259","messageId":"xmqqy0zkj84f.fsf@gitster.g","threadId":"62625","inReplyTo":"Z3-i5mB4JVeONy4O@pks.im","subject":"Re: [PATCH v2 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-09T15:54:08Z","receivedAt":"2025-01-09T15:54:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> So I'm inclined to leave this as-is, maybe adding an escape hatch to\n> silence the warnings via an environment variable to give users a bit of\n> time to migrate.\n\nOK.  I strongly prefer simpler implementation, as long as it won't\nmake end-user experience (over time across Git 3.0 boundary) overly\nunpleasant.\n\nNumbing the pain for short-term gain and letting the inevitable\nremoval (not deprecation) suddenly hit them is also extremely\nunpleasant at Git 3.0 boundary, and such a pain is probably a\nproblem of their own creation, but I learned after Git 1.6 fiasco\nthat users always blame us for their own failings, so I still am\nfairly reluctant to see us offer a way to squelch the warnings too\neasily and forget about it.\n\nThanks.\n"},{"id":"511050","messageId":"20250122-pks-remote-branches-deprecation-v4-0-5cbf5b28afd5@pks.im","threadId":"62625","inReplyTo":"20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im","subject":"[PATCH v4 0/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-22T11:31:28Z","receivedAt":"2025-01-22T11:31:36Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nback when Git was in its infancy, remotes were configured via separate\nfiles in \"branches/\" (back in 2005). Later that year we introduced a\nmore powerful mechanism with the \"remotes/\" directory. These mechanism\nhave eventually been superseded by config-based remotes, and it is very\nunlikely that anybody still uses these directories to configure their\nremotes. Both of these directories have been marked as deprecated, one\nin 2005 and the other one in 2011.\n\nThis patch series follows through with the deprecation of these and\nannounces them for removal in Git 3.0. Furthermore, it creates the infra\nto compile Git with such breaking changes enabled and wires up a CI job\nboth for GitHub and GitLab to test those breaking changes.\n\nThe series is based on top caacdb5dfd (The fifteenth batch, 2024-12-10)\nwith ps/build at 904339edbd (Introduce support for the Meson build\nsystem, 2024-12-06) merged into it.\n\nChanges in v2:\n- Some small fixes to the deprecation notice of \"branches/\" and\n  \"remotes/\".\n- Some small fixes to commit messages.\n- Link to v1: https://lore.kernel.org/r/20241211-pks-remote-branches-deprecation-v1-0-1431e2369135@pks.im\n\nChanges in v3:\n- Print warnings when reading remotes from \"remotes/\" or \"branches/\".\n- A couple of commit mesasge improvements.\n- Link to v2: https://lore.kernel.org/r/20250106-pks-remote-branches-deprecation-v2-0-2ce87c053536@pks.im\n\nChanges in v4:\n- Add migration instructions to the warning when reading deprecated\n  remote types.\n- Clarify the deprecation text a bit.\n- Link to v3: https://lore.kernel.org/r/20250120-pks-remote-branches-deprecation-v3-0-c7e539b6a84f@pks.im\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (5):\n      Makefile: wire up build option for deprecated features\n      ci: merge linux-gcc-default into linux-gcc\n      ci: repurpose \"linux-gcc\" job for deprecations\n      builtin/pack-redundant: remove subcommand with breaking changes\n      remote: announce removal of \"branches/\" and \"remotes/\"\n\n .github/workflows/main.yml             |  6 +----\n .gitlab-ci.yml                         |  6 +----\n Documentation/BreakingChanges.txt      | 25 ++++++++++++++++++\n Documentation/gitrepository-layout.txt |  7 +++--\n GIT-BUILD-OPTIONS.in                   |  1 +\n Makefile                               |  7 +++++\n builtin/remote.c                       |  2 ++\n ci/lib.sh                              |  5 ----\n ci/run-build-and-tests.sh              |  3 ++-\n contrib/buildsystems/CMakeLists.txt    |  1 +\n git.c                                  |  2 ++\n meson.build                            |  6 +++++\n meson_options.txt                      |  2 ++\n remote.c                               | 26 +++++++++++++++++++\n remote.h                               |  2 ++\n t/t5323-pack-redundant.sh              |  6 +++++\n t/t5505-remote.sh                      |  6 ++---\n t/t5510-fetch.sh                       | 13 ++++------\n t/t5515-fetch-merge-logic.sh           | 47 ++++++++++++++++++----------------\n t/t5516-fetch-push.sh                  | 14 +++++-----\n t/test-lib.sh                          |  4 +++\n 21 files changed, 132 insertions(+), 59 deletions(-)\n\nRange-diff versus v3:\n\n1:  c9ab464545 = 1:  b72e562c5a Makefile: wire up build option for deprecated features\n2:  992c55543e = 2:  a6c0aa40f0 ci: merge linux-gcc-default into linux-gcc\n3:  e9d9721fbf = 3:  c4aa9d092b ci: repurpose \"linux-gcc\" job for deprecations\n4:  2588dff0f8 = 4:  7977a853ef builtin/pack-redundant: remove subcommand with breaking changes\n5:  671a527782 ! 5:  c607948f6a remote: announce removal of \"branches/\" and \"remotes/\"\n    @@ Documentation/BreakingChanges.txt: Cf. <xmqq1rjuz6n3.fsf_-_@gitster.c.googlers.c\n     +As our documentation mentions, these directories are not to be found in modern\n     +repositories at all and most users aren't even aware of these mechanisms. They\n     +have been deprecated for almost 20 years and 14 years respectively, and we are\n    -+not aware of any reason why anybody would want to use these mechanisms.\n    ++not aware of any active users that have complained about this deprecation.\n     +Furthermore, the \".git/branches/\" directory is nowadays misleadingly named and\n     +may cause confusion as \"branches\" are almost exclusively used in the context of\n     +references.\n    @@ remote.c: static void add_instead_of(struct rewrite *rewrite, const char *instea\n      static const char *skip_spaces(const char *s)\n      {\n      \twhile (isspace(*s))\n    +@@ remote.c: static const char *skip_spaces(const char *s)\n    + \treturn s;\n    + }\n    + \n    ++static void warn_about_deprecated_remote_type(const char *type,\n    ++\t\t\t\t\t      const struct remote *remote)\n    ++{\n    ++\twarning(_(\"reading remote from \\\"%s/%s\\\", which is nominated for removal.\\n\"\n    ++\t\t  \"\\n\"\n    ++\t\t  \"If you still use the \\\"remotes/\\\" directory it is recommended to\\n\"\n    ++\t\t  \"migrate to config-based remotes:\\n\"\n    ++\t\t  \"\\n\"\n    ++\t\t  \"\\tgit remote rename %s %s\\n\"\n    ++\t\t  \"\\n\"\n    ++\t\t  \"If you cannot, please let us know you still use it by sending an\\n\"\n    ++\t\t  \"e-mail to <git@vger.kernel.org>.\"),\n    ++\t\ttype, remote->name, remote->name, remote->name);\n    ++}\n    ++\n    + static void read_remotes_file(struct remote_state *remote_state,\n    + \t\t\t      struct remote *remote)\n    + {\n     @@ remote.c: static void read_remotes_file(struct remote_state *remote_state,\n      \n      \tif (!f)\n      \t\treturn;\n     +\n    -+\twarning(_(\"Reading remote from \\\"remotes/%s\\\", which is nominated\\n\"\n    -+\t\t  \"for removal. If you still use the \\\"remotes/\\\" directory\\n\"\n    -+\t\t  \"it is recommended to migrate to config-based remotes. If\\n\"\n    -+\t\t  \"you cannot, please let us know you still use it by sending\\n\"\n    -+\t\t  \"an e-mail to <git@vger.kernel.org>.\"), remote->name);\n    ++\twarn_about_deprecated_remote_type(\"remotes\", remote);\n     +\n      \tremote->configured_in_repo = 1;\n      \tremote->origin = REMOTE_REMOTES;\n    @@ remote.c: static void read_branches_file(struct remote_state *remote_state,\n      \tif (!f)\n      \t\treturn;\n      \n    -+\twarning(_(\"Reading remote from \\\"branches/%s\\\", which is nominated\\n\"\n    -+\t\t  \"for removal. If you still use the \\\"branches/\\\" directory\\n\"\n    -+\t\t  \"it is recommended to migrate to config-based remotes. If\\n\"\n    -+\t\t  \"you cannot, please let us know you still use it by sending\\n\"\n    -+\t\t  \"an e-mail to <git@vger.kernel.org>.\"), remote->name);\n    ++\twarn_about_deprecated_remote_type(\"branches\", remote);\n     +\n      \tstrbuf_getline_lf(&buf, f);\n      \tfclose(f);\n\n---\nbase-commit: 713ec79a9091cec60b110d605b418904759982ab\nchange-id: 20241205-pks-remote-branches-deprecation-037a4389a377\n\n"},{"id":"511051","messageId":"20250122-pks-remote-branches-deprecation-v4-1-5cbf5b28afd5@pks.im","threadId":"62625","inReplyTo":"20250122-pks-remote-branches-deprecation-v4-0-5cbf5b28afd5@pks.im","subject":"[PATCH v4 1/5] Makefile: wire up build option for deprecated features","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-22T11:31:29Z","receivedAt":"2025-01-22T11:31:37Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"With 57ec9254eb (docs: introduce document to announce breaking changes,\n2024-06-14), we have introduced a new document that tracks upcoming\nbreaking changes in the Git project. In 2454970930 (BreakingChanges:\nearly adopter option, 2024-10-11) we have amended the document a bit to\nmention that any introduced breaking changes must be accompanied by\nlogic that allows us to enable the breaking change at compile-time.\nWhile we already have two breaking changes lined up, neither of them has\nsuch a switch because they predate those instructions.\n\nIntroduce the proposed `WITH_BREAKING_CHANGES` preprocessor macro and\nwire it up with both our Makefiles and Meson. This does not yet wire up\nthe build flag for existing deprecations.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n GIT-BUILD-OPTIONS.in                | 1 +\n Makefile                            | 5 +++++\n contrib/buildsystems/CMakeLists.txt | 1 +\n meson.build                         | 6 ++++++\n meson_options.txt                   | 2 ++\n t/test-lib.sh                       | 4 ++++\n 6 files changed, 19 insertions(+)\n\ndiff --git a/GIT-BUILD-OPTIONS.in b/GIT-BUILD-OPTIONS.in\nindex f651116102..f1d0ecf123 100644\n--- a/GIT-BUILD-OPTIONS.in\n+++ b/GIT-BUILD-OPTIONS.in\n@@ -45,3 +45,4 @@ GITWEBDIR=@GITWEBDIR@\n USE_GETTEXT_SCHEME=@USE_GETTEXT_SCHEME@\n LOCALEDIR=@LOCALEDIR@\n BROKEN_PATH_FIX=@BROKEN_PATH_FIX@\n+WITH_BREAKING_CHANGES=@WITH_BREAKING_CHANGES@\ndiff --git a/Makefile b/Makefile\nindex 06f01149ec..dc3c980aa7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2230,6 +2230,10 @@ ifdef FSMONITOR_OS_SETTINGS\n \tCOMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_OS_SETTINGS).o\n endif\n \n+ifdef WITH_BREAKING_CHANGES\n+\tBASIC_CFLAGS += -DWITH_BREAKING_CHANGES\n+endif\n+\n ifeq ($(TCLTK_PATH),)\n NO_TCLTK = NoThanks\n endif\n@@ -3187,6 +3191,7 @@ GIT-BUILD-OPTIONS: FORCE\n \t\t-e \"s|@USE_GETTEXT_SCHEME@|\\'$(USE_GETTEXT_SCHEME)\\'|\" \\\n \t\t-e \"s|@LOCALEDIR@|\\'$(localedir_SQ)\\'|\" \\\n \t\t-e \"s!@BROKEN_PATH_FIX@!\\'$(BROKEN_PATH_FIX)\\'!\" \\\n+\t\t-e \"s|@WITH_BREAKING_CHANGES@|\\'$(WITH_BREAKING_CHANGES)\\'|\" \\\n \t\tGIT-BUILD-OPTIONS.in >$@+\n \t@if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo \"Unsubstituted build options in $@\" >&2 && exit 1; fi\n \t@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 49904ca8a9..63d0088928 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -1198,6 +1198,7 @@ string(REPLACE \"@GITWEBDIR@\" \"'${GITWEBDIR}'\" git_build_options \"${git_build_opt\n string(REPLACE \"@USE_GETTEXT_SCHEME@\" \"\" git_build_options \"${git_build_options}\")\n string(REPLACE \"@LOCALEDIR@\" \"'${LOCALEDIR}'\" git_build_options \"${git_build_options}\")\n string(REPLACE \"@BROKEN_PATH_FIX@\" \"\" git_build_options \"${git_build_options}\")\n+string(REPLACE \"@WITH_BREAKING_CHANGES@\" \"\" git_build_options \"${git_build_options}\")\n if(USE_VCPKG)\n \tstring(APPEND git_build_options \"PATH=\\\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\\\"\\n\")\n endif()\ndiff --git a/meson.build b/meson.build\nindex 0dccebcdf1..316cd93264 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -644,6 +644,12 @@ build_options_config.set('GIT_TEST_UTF8_LOCALE', '')\n build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))\n build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n \n+if get_option('breaking_changes')\n+  build_options_config.set('WITH_BREAKING_CHANGES', 'YesPlease')\n+else\n+  build_options_config.set('WITH_BREAKING_CHANGES', '')\n+endif\n+\n if get_option('sane_tool_path') != ''\n   build_options_config.set_quoted('BROKEN_PATH_FIX', 's|^\\# @BROKEN_PATH_FIX@$|git_broken_path_fix \"' + get_option('sane_tool_path') + '\"|')\n else\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 32a72139ba..800e518d95 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -43,6 +43,8 @@ option('sha256_backend', type: 'combo', choices: ['openssl', 'nettle', 'gcrypt',\n   description: 'The backend used for hashing objects with the SHA256 object format')\n \n # Build tweaks.\n+option('breaking_changes', type: 'boolean', value: false,\n+  description: 'Enable upcoming breaking changes.')\n option('macos_use_homebrew_gettext', type: 'boolean', value: true,\n   description: 'Use gettext from Homebrew instead of the slightly-broken system-provided one.')\n \ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 62dfcc4aaf..6e423f655d 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1864,6 +1864,10 @@ test_lazy_prereq CURL '\n \tcurl --version\n '\n \n+test_lazy_prereq WITHOUT_BREAKING_CHANGES '\n+\ttest -z \"$WITH_BREAKING_CHANGES\"\n+'\n+\n # SHA1 is a test if the hash algorithm in use is SHA-1.  This is both for tests\n # which will not work with other hash algorithms and tests that work but don't\n # test anything meaningful (e.g. special values which cause short collisions).\n\n-- \n2.48.1.321.gbf1f004a4a.dirty\n\n"},{"id":"511052","messageId":"20250122-pks-remote-branches-deprecation-v4-2-5cbf5b28afd5@pks.im","threadId":"62625","inReplyTo":"20250122-pks-remote-branches-deprecation-v4-0-5cbf5b28afd5@pks.im","subject":"[PATCH v4 2/5] ci: merge linux-gcc-default into linux-gcc","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-22T11:31:30Z","receivedAt":"2025-01-22T11:31:38Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The \"linux-gcc-default\" job is mostly doing the same as the \"linux-gcc\"\njob, except for a couple of minor differences:\n\n  - We use an explicit GCC version instead of the default version\n    provided by the distribution. We have other jobs that test with\n    \"gcc-8\", making this distinction pointless.\n\n  - We don't set up the Python version explicitly, and instead use the\n    default Python version. Python 2 has been end-of-life for quite a\n    while now though, making this distinction less interesting.\n\n  - We set up the default branch name to be \"main\" in \"linux-gcc\". We\n    have other testcases that don't and also some that explicitly use\n    \"master\".\n\n  - We use \"ubuntu:20.04\" in one job and \"ubuntu:latest\" in another. We\n    already have a couple other jobs testing these respectively.\n\nSo overall, the job does not add much to our test coverage.\n\nDrop the \"linux-gcc-default\" job and adapt \"linux-gcc\" to start using\nthe default GCC compiler, effectively merging those two jobs into one.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n .github/workflows/main.yml | 4 ----\n .gitlab-ci.yml             | 4 ----\n ci/lib.sh                  | 5 -----\n 3 files changed, 13 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 808ddc19b8..32d35d2257 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -271,7 +271,6 @@ jobs:\n             pool: ubuntu-latest\n           - jobname: linux-gcc\n             cc: gcc\n-            cc_package: gcc-8\n             pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\n             cc: gcc\n@@ -286,9 +285,6 @@ jobs:\n           - jobname: osx-gcc\n             cc: gcc-13\n             pool: macos-13\n-          - jobname: linux-gcc-default\n-            cc: gcc\n-            pool: ubuntu-latest\n           - jobname: linux-leaks\n             cc: gcc\n             pool: ubuntu-latest\ndiff --git a/.gitlab-ci.yml b/.gitlab-ci.yml\nindex a1bc92893f..b86bb0bdb3 100644\n--- a/.gitlab-ci.yml\n+++ b/.gitlab-ci.yml\n@@ -46,14 +46,10 @@ test:linux:\n       - jobname: linux-gcc\n         image: ubuntu:20.04\n         CC: gcc\n-        CC_PACKAGE: gcc-8\n       - jobname: linux-TEST-vars\n         image: ubuntu:20.04\n         CC: gcc\n         CC_PACKAGE: gcc-8\n-      - jobname: linux-gcc-default\n-        image: ubuntu:latest\n-        CC: gcc\n       - jobname: linux-leaks\n         image: ubuntu:latest\n         CC: gcc\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 930f98d722..e67c481d4f 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -328,11 +328,6 @@ export SKIP_DASHED_BUILT_INS=YesPlease\n \n case \"$distro\" in\n ubuntu-*)\n-\tif test \"$jobname\" = \"linux-gcc-default\"\n-\tthen\n-\t\tbreak\n-\tfi\n-\n \t# Python 2 is end of life, and Ubuntu 23.04 and newer don't actually\n \t# have it anymore. We thus only test with Python 2 on older LTS\n \t# releases.\n\n-- \n2.48.1.321.gbf1f004a4a.dirty\n\n"},{"id":"511053","messageId":"20250122-pks-remote-branches-deprecation-v4-3-5cbf5b28afd5@pks.im","threadId":"62625","inReplyTo":"20250122-pks-remote-branches-deprecation-v4-0-5cbf5b28afd5@pks.im","subject":"[PATCH v4 3/5] ci: repurpose \"linux-gcc\" job for deprecations","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-22T11:31:31Z","receivedAt":"2025-01-22T11:31:39Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The \"linux-gcc\" job isn't all that interesting by itself and can be\nconsidered more or less the \"standard\" job: it is running with a\nreasonably up-to-date image and uses GCC as a compiler, both of which we\nalready cover in other jobs.\n\nThere is one exception though: we change the default branch to be \"main\"\ninstead of \"master\", so it is forging ahead a bit into the future to\nmake sure that this change does not cause havoc. So let's expand on this\na bit and also add the new \"WITH_BREAKING_CHANGES\" flag to the mix.\n\nRename the job to \"linux-breaking-changes\" accordingly.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n .github/workflows/main.yml | 2 +-\n .gitlab-ci.yml             | 2 +-\n ci/run-build-and-tests.sh  | 3 ++-\n 3 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 32d35d2257..46b96fb96c 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -269,7 +269,7 @@ jobs:\n           - jobname: linux-reftable\n             cc: clang\n             pool: ubuntu-latest\n-          - jobname: linux-gcc\n+          - jobname: linux-breaking-changes\n             cc: gcc\n             pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\ndiff --git a/.gitlab-ci.yml b/.gitlab-ci.yml\nindex b86bb0bdb3..492e5d9082 100644\n--- a/.gitlab-ci.yml\n+++ b/.gitlab-ci.yml\n@@ -43,7 +43,7 @@ test:linux:\n       - jobname: linux-reftable\n         image: ubuntu:latest\n         CC: clang\n-      - jobname: linux-gcc\n+      - jobname: linux-breaking-changes\n         image: ubuntu:20.04\n         CC: gcc\n       - jobname: linux-TEST-vars\ndiff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh\nindex 2e28d02b20..2ccd812fb4 100755\n--- a/ci/run-build-and-tests.sh\n+++ b/ci/run-build-and-tests.sh\n@@ -13,8 +13,9 @@ esac\n run_tests=t\n \n case \"$jobname\" in\n-linux-gcc)\n+linux-breaking-changes)\n \texport GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n+\texport WITH_BREAKING_CHANGES=YesPlease\n \t;;\n linux-TEST-vars)\n \texport GIT_TEST_SPLIT_INDEX=yes\n\n-- \n2.48.1.321.gbf1f004a4a.dirty\n\n"},{"id":"511054","messageId":"20250122-pks-remote-branches-deprecation-v4-4-5cbf5b28afd5@pks.im","threadId":"62625","inReplyTo":"20250122-pks-remote-branches-deprecation-v4-0-5cbf5b28afd5@pks.im","subject":"[PATCH v4 4/5] builtin/pack-redundant: remove subcommand with breaking changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-22T11:31:32Z","receivedAt":"2025-01-22T11:31:39Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The git-pack-redundant(1) subcommand has been announced for removal with\n53a92c9552 (Documentation/BreakingChanges: announce removal of\ngit-pack-redundant(1), 2024-09-02). Stop compiling the subcommand in\ncase the `WITH_BREAKING_CHANGES` build flag is set.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Makefile                  | 2 ++\n git.c                     | 2 ++\n t/t5323-pack-redundant.sh | 6 ++++++\n 3 files changed, 10 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex dc3c980aa7..e6b0d85980 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1278,7 +1278,9 @@ BUILTIN_OBJS += builtin/mv.o\n BUILTIN_OBJS += builtin/name-rev.o\n BUILTIN_OBJS += builtin/notes.o\n BUILTIN_OBJS += builtin/pack-objects.o\n+ifndef WITH_BREAKING_CHANGES\n BUILTIN_OBJS += builtin/pack-redundant.o\n+endif\n BUILTIN_OBJS += builtin/pack-refs.o\n BUILTIN_OBJS += builtin/patch-id.o\n BUILTIN_OBJS += builtin/prune-packed.o\ndiff --git a/git.c b/git.c\nindex 46b3c740c5..a13c32bcdc 100644\n--- a/git.c\n+++ b/git.c\n@@ -589,7 +589,9 @@ static struct cmd_struct commands[] = {\n \t{ \"name-rev\", cmd_name_rev, RUN_SETUP },\n \t{ \"notes\", cmd_notes, RUN_SETUP },\n \t{ \"pack-objects\", cmd_pack_objects, RUN_SETUP },\n+#ifndef WITH_BREAKING_CHANGES\n \t{ \"pack-redundant\", cmd_pack_redundant, RUN_SETUP | NO_PARSEOPT },\n+#endif\n \t{ \"pack-refs\", cmd_pack_refs, RUN_SETUP },\n \t{ \"patch-id\", cmd_patch_id, RUN_SETUP_GENTLY | NO_PARSEOPT },\n \t{ \"pickaxe\", cmd_blame, RUN_SETUP },\ndiff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh\nindex 8dbbcc5e51..688cd9706c 100755\n--- a/t/t5323-pack-redundant.sh\n+++ b/t/t5323-pack-redundant.sh\n@@ -36,6 +36,12 @@ relationship between packs and objects is as follows:\n \n . ./test-lib.sh\n \n+if ! test_have_prereq WITHOUT_BREAKING_CHANGES\n+then\n+\tskip_all='skipping git-pack-redundant tests; built with breaking changes'\n+\ttest_done\n+fi\n+\n main_repo=main.git\n shared_repo=shared.git\n \n\n-- \n2.48.1.321.gbf1f004a4a.dirty\n\n"},{"id":"511055","messageId":"20250122-pks-remote-branches-deprecation-v4-5-5cbf5b28afd5@pks.im","threadId":"62625","inReplyTo":"20250122-pks-remote-branches-deprecation-v4-0-5cbf5b28afd5@pks.im","subject":"[PATCH v4 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-22T11:31:33Z","receivedAt":"2025-01-22T11:31:40Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Back when Git was in its infancy, remotes were configured via separate\nfiles in \"branches/\" (back in 2005). This mechanism was replaced later\nthat year with the \"remotes/\" directory. Both mechanisms have eventually\nbeen replaced by config-based remotes, and it is very unlikely that\nanybody still uses these directories to configure their remotes.\n\nBoth of these directories have been marked as deprecated, one in 2005\nand the other one in 2011. Follow through with the deprecation and\nfinally announce the removal of these features in Git 3.0.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/BreakingChanges.txt      | 25 ++++++++++++++++++\n Documentation/gitrepository-layout.txt |  7 +++--\n builtin/remote.c                       |  2 ++\n remote.c                               | 26 +++++++++++++++++++\n remote.h                               |  2 ++\n t/t5505-remote.sh                      |  6 ++---\n t/t5510-fetch.sh                       | 13 ++++------\n t/t5515-fetch-merge-logic.sh           | 47 ++++++++++++++++++----------------\n t/t5516-fetch-push.sh                  | 14 +++++-----\n 9 files changed, 99 insertions(+), 43 deletions(-)\n\ndiff --git a/Documentation/BreakingChanges.txt b/Documentation/BreakingChanges.txt\nindex 27acff86db..7c388e56c8 100644\n--- a/Documentation/BreakingChanges.txt\n+++ b/Documentation/BreakingChanges.txt\n@@ -154,6 +154,31 @@ Cf. <xmqq1rjuz6n3.fsf_-_@gitster.c.googlers.com>,\n     <CAKvOHKAFXQwt4D8yUCCkf_TQL79mYaJ=KAKhtpDNTvHJFuX1NA@mail.gmail.com>,\n     <20230323204047.GA9290@coredump.intra.peff.net>,\n \n+* Support for storing shorthands for remote URLs in \"$GIT_COMMON_DIR/branches/\"\n+  and \"$GIT_COMMON_DIR/remotes/\" has been long superseded by storing remotes in\n+  the repository configuration.\n++\n+The mechanism has originally been introduced in f170e4b39d ([PATCH] fetch/pull:\n+short-hand notation for remote repositories., 2005-07-16) and was superseded by\n+6687f8fea2 ([PATCH] Use .git/remote/origin, not .git/branches/origin.,\n+2005-08-20), where we switched from \".git/branches/\" to \".git/remotes/\". That\n+commit already mentions an upcoming deprecation of the \".git/branches/\"\n+directory, and starting with a1d4aa7424 (Add repository-layout document.,\n+2005-09-01) we have also marked this layout as deprecated. Eventually we also\n+started to migrate away from \".git/remotes/\" in favor of config-based remotes,\n+and we have marked the directory as legacy in 3d3d282146 (Documentation:\n+Grammar correction, wording fixes and cleanup, 2011-08-23)\n++\n+As our documentation mentions, these directories are not to be found in modern\n+repositories at all and most users aren't even aware of these mechanisms. They\n+have been deprecated for almost 20 years and 14 years respectively, and we are\n+not aware of any active users that have complained about this deprecation.\n+Furthermore, the \".git/branches/\" directory is nowadays misleadingly named and\n+may cause confusion as \"branches\" are almost exclusively used in the context of\n+references.\n++\n+These features will be removed.\n+\n == Superseded features that will not be deprecated\n \n Some features have gained newer replacements that aim to improve the design in\ndiff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt\nindex fa8b51daf0..85911ca8ea 100644\n--- a/Documentation/gitrepository-layout.txt\n+++ b/Documentation/gitrepository-layout.txt\n@@ -153,7 +153,7 @@ config.worktree::\n \tlinkgit:git-worktree[1]).\n \n branches::\n-\tA slightly deprecated way to store shorthands to be used\n+\tA deprecated way to store shorthands to be used\n \tto specify a URL to 'git fetch', 'git pull' and 'git push'.\n \tA file can be stored as `branches/<name>` and then\n \t'name' can be given to these commands in place of\n@@ -162,7 +162,8 @@ branches::\n \tand not likely to be found in modern repositories. This\n \tdirectory is ignored if $GIT_COMMON_DIR is set and\n \t\"$GIT_COMMON_DIR/branches\" will be used instead.\n-\n++\n+Git will stop reading remotes from this directory in Git 3.0.\n \n hooks::\n \tHooks are customization scripts used by various Git\n@@ -238,6 +239,8 @@ remotes::\n \tand not likely to be found in modern repositories. This\n \tdirectory is ignored if $GIT_COMMON_DIR is set and\n \t\"$GIT_COMMON_DIR/remotes\" will be used instead.\n++\n+Git will stop reading remotes from this directory in Git 3.0.\n \n logs::\n \tRecords of changes made to refs are stored in this directory.\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 1ad3e70a6b..e565b2b3fe 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -640,10 +640,12 @@ static int migrate_file(struct remote *remote)\n \tstrbuf_addf(&buf, \"remote.%s.fetch\", remote->name);\n \tfor (i = 0; i < remote->fetch.nr; i++)\n \t\tgit_config_set_multivar(buf.buf, remote->fetch.items[i].raw, \"^$\", 0);\n+#ifndef WITH_BREAKING_CHANGES\n \tif (remote->origin == REMOTE_REMOTES)\n \t\tunlink_or_warn(git_path(\"remotes/%s\", remote->name));\n \telse if (remote->origin == REMOTE_BRANCHES)\n \t\tunlink_or_warn(git_path(\"branches/%s\", remote->name));\n+#endif /* WITH_BREAKING_CHANGES */\n \tstrbuf_release(&buf);\n \n \treturn 0;\ndiff --git a/remote.c b/remote.c\nindex 10104d11e3..ec69863f11 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -293,6 +293,7 @@ static void add_instead_of(struct rewrite *rewrite, const char *instead_of)\n \trewrite->instead_of_nr++;\n }\n \n+#ifndef WITH_BREAKING_CHANGES\n static const char *skip_spaces(const char *s)\n {\n \twhile (isspace(*s))\n@@ -300,6 +301,21 @@ static const char *skip_spaces(const char *s)\n \treturn s;\n }\n \n+static void warn_about_deprecated_remote_type(const char *type,\n+\t\t\t\t\t      const struct remote *remote)\n+{\n+\twarning(_(\"reading remote from \\\"%s/%s\\\", which is nominated for removal.\\n\"\n+\t\t  \"\\n\"\n+\t\t  \"If you still use the \\\"remotes/\\\" directory it is recommended to\\n\"\n+\t\t  \"migrate to config-based remotes:\\n\"\n+\t\t  \"\\n\"\n+\t\t  \"\\tgit remote rename %s %s\\n\"\n+\t\t  \"\\n\"\n+\t\t  \"If you cannot, please let us know you still use it by sending an\\n\"\n+\t\t  \"e-mail to <git@vger.kernel.org>.\"),\n+\t\ttype, remote->name, remote->name, remote->name);\n+}\n+\n static void read_remotes_file(struct remote_state *remote_state,\n \t\t\t      struct remote *remote)\n {\n@@ -308,6 +324,9 @@ static void read_remotes_file(struct remote_state *remote_state,\n \n \tif (!f)\n \t\treturn;\n+\n+\twarn_about_deprecated_remote_type(\"remotes\", remote);\n+\n \tremote->configured_in_repo = 1;\n \tremote->origin = REMOTE_REMOTES;\n \twhile (strbuf_getline(&buf, f) != EOF) {\n@@ -337,6 +356,8 @@ static void read_branches_file(struct remote_state *remote_state,\n \tif (!f)\n \t\treturn;\n \n+\twarn_about_deprecated_remote_type(\"branches\", remote);\n+\n \tstrbuf_getline_lf(&buf, f);\n \tfclose(f);\n \tstrbuf_trim(&buf);\n@@ -374,6 +395,7 @@ static void read_branches_file(struct remote_state *remote_state,\n \tstrbuf_release(&buf);\n \tfree(to_free);\n }\n+#endif /* WITH_BREAKING_CHANGES */\n \n static int handle_config(const char *key, const char *value,\n \t\t\t const struct config_context *ctx, void *cb)\n@@ -572,6 +594,7 @@ static void read_config(struct repository *repo, int early)\n \talias_all_urls(repo->remote_state);\n }\n \n+#ifndef WITH_BREAKING_CHANGES\n static int valid_remote_nick(const char *name)\n {\n \tif (!name[0] || is_dot_or_dotdot(name))\n@@ -583,6 +606,7 @@ static int valid_remote_nick(const char *name)\n \t\t\treturn 0;\n \treturn 1;\n }\n+#endif /* WITH_BREAKING_CHANGES */\n \n static const char *remotes_remote_for_branch(struct remote_state *remote_state,\n \t\t\t\t\t     struct branch *branch,\n@@ -725,12 +749,14 @@ remotes_remote_get_1(struct remote_state *remote_state, const char *name,\n \t\t\t\t   &name_given);\n \n \tret = make_remote(remote_state, name, 0);\n+#ifndef WITH_BREAKING_CHANGES\n \tif (valid_remote_nick(name) && have_git_dir()) {\n \t\tif (!valid_remote(ret))\n \t\t\tread_remotes_file(remote_state, ret);\n \t\tif (!valid_remote(ret))\n \t\t\tread_branches_file(remote_state, ret);\n \t}\n+#endif /* WITH_BREAKING_CHANGES */\n \tif (name_given && !valid_remote(ret))\n \t\tadd_url_alias(remote_state, ret, name);\n \tif (!valid_remote(ret))\ndiff --git a/remote.h b/remote.h\nindex a7e5c4e07c..45b0c9babb 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -21,8 +21,10 @@ struct transport_ls_refs_options;\n enum {\n \tREMOTE_UNCONFIGURED = 0,\n \tREMOTE_CONFIG,\n+#ifndef WITH_BREAKING_CHANGES\n \tREMOTE_REMOTES,\n \tREMOTE_BRANCHES\n+#endif /* WITH_BREAKING_CHANGES */\n };\n \n struct rewrite {\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex 08424e878e..e96ac8c767 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -1007,7 +1007,7 @@ Pull: refs/heads/main:refs/heads/origin\n Pull: refs/heads/next:refs/heads/origin2\n EOF\n \n-test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '\n \tgit clone one five &&\n \torigin_url=$(pwd)/one &&\n \t(\n@@ -1033,7 +1033,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \t)\n '\n \n-test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '\n \tgit clone --template= one six &&\n \torigin_url=$(pwd)/one &&\n \t(\n@@ -1049,7 +1049,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \t)\n '\n \n-test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '\n \tgit clone --template= one seven &&\n \t(\n \t\tcd seven &&\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 3b3991ab86..04d8a96367 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -34,14 +34,11 @@ test_expect_success \"clone and setup child repos\" '\n \tgit clone . three &&\n \t(\n \t\tcd three &&\n-\t\tgit config branch.main.remote two &&\n-\t\tgit config branch.main.merge refs/heads/one &&\n-\t\tmkdir -p .git/remotes &&\n-\t\tcat >.git/remotes/two <<-\\EOF\n-\t\tURL: ../two/.git/\n-\t\tPull: refs/heads/main:refs/heads/two\n-\t\tPull: refs/heads/one:refs/heads/one\n-\t\tEOF\n+\t\tgit config set remote.two.url ../two/.git/ &&\n+\t\tgit config set remote.two.fetch refs/heads/main:refs/heads/two &&\n+\t\tgit config set --append remote.two.fetch refs/heads/one:refs/heads/one &&\n+\t\tgit config set branch.main.remote two &&\n+\t\tgit config set branch.main.merge refs/heads/one\n \t) &&\n \tgit clone . bundle &&\n \tgit clone . seven\ndiff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh\nindex 320d26796d..4e6026c611 100755\n--- a/t/t5515-fetch-merge-logic.sh\n+++ b/t/t5515-fetch-merge-logic.sh\n@@ -104,28 +104,31 @@ test_expect_success setup '\n \tgit config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&\n \tremotes=\"$remotes config-glob\" &&\n \n-\tmkdir -p .git/remotes &&\n-\tcat >.git/remotes/remote-explicit <<-\\EOF &&\n-\tURL: ../.git/\n-\tPull: refs/heads/main:remotes/rem/main\n-\tPull: refs/heads/one:remotes/rem/one\n-\tPull: two:remotes/rem/two\n-\tPull: refs/heads/three:remotes/rem/three\n-\tEOF\n-\tremotes=\"$remotes remote-explicit\" &&\n-\n-\tcat >.git/remotes/remote-glob <<-\\EOF &&\n-\tURL: ../.git/\n-\tPull: refs/heads/*:refs/remotes/rem/*\n-\tEOF\n-\tremotes=\"$remotes remote-glob\" &&\n-\n-\tmkdir -p .git/branches &&\n-\techo \"../.git\" > .git/branches/branches-default &&\n-\tremotes=\"$remotes branches-default\" &&\n-\n-\techo \"../.git#one\" > .git/branches/branches-one &&\n-\tremotes=\"$remotes branches-one\" &&\n+\tif test_have_prereq WITHOUT_BREAKING_CHANGES\n+\tthen\n+\t\tmkdir -p .git/remotes &&\n+\t\tcat >.git/remotes/remote-explicit <<-\\EOF &&\n+\t\tURL: ../.git/\n+\t\tPull: refs/heads/main:remotes/rem/main\n+\t\tPull: refs/heads/one:remotes/rem/one\n+\t\tPull: two:remotes/rem/two\n+\t\tPull: refs/heads/three:remotes/rem/three\n+\t\tEOF\n+\t\tremotes=\"$remotes remote-explicit\" &&\n+\n+\t\tcat >.git/remotes/remote-glob <<-\\EOF &&\n+\t\tURL: ../.git/\n+\t\tPull: refs/heads/*:refs/remotes/rem/*\n+\t\tEOF\n+\t\tremotes=\"$remotes remote-glob\" &&\n+\n+\t\tmkdir -p .git/branches &&\n+\t\techo \"../.git\" > .git/branches/branches-default &&\n+\t\tremotes=\"$remotes branches-default\" &&\n+\n+\t\techo \"../.git#one\" > .git/branches/branches-one &&\n+\t\tremotes=\"$remotes branches-one\"\n+\tfi &&\n \n \tfor remote in $remotes ; do\n \t\tgit config branch.br-$remote.remote $remote &&\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 9d693eb57f..e705aedbf4 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -975,7 +975,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' '\n \t! grep \"warning: updating the current branch\" stderr\n '\n \n-test_expect_success 'fetch with branches' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '\n \tmk_empty testrepo &&\n \tgit branch second $the_first_commit &&\n \tgit checkout second &&\n@@ -991,7 +991,7 @@ test_expect_success 'fetch with branches' '\n \tgit checkout main\n '\n \n-test_expect_success 'fetch with branches containing #' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #' '\n \tmk_empty testrepo &&\n \tmkdir testrepo/.git/branches &&\n \techo \"..#second\" > testrepo/.git/branches/branch2 &&\n@@ -1005,7 +1005,7 @@ test_expect_success 'fetch with branches containing #' '\n \tgit checkout main\n '\n \n-test_expect_success 'push with branches' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '\n \tmk_empty testrepo &&\n \tgit checkout second &&\n \n@@ -1022,7 +1022,7 @@ test_expect_success 'push with branches' '\n \t)\n '\n \n-test_expect_success 'push with branches containing #' '\n+test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches containing #' '\n \tmk_empty testrepo &&\n \n \ttest_when_finished \"rm -rf .git/branches\" &&\n@@ -1211,18 +1211,16 @@ test_expect_success 'push --porcelain --dry-run rejected' '\n '\n \n test_expect_success 'push --prune' '\n-\tmk_test testrepo heads/main heads/second heads/foo heads/bar &&\n+\tmk_test testrepo heads/main heads/foo heads/bar &&\n \tgit push --prune testrepo : &&\n \tcheck_push_result testrepo $the_commit heads/main &&\n-\tcheck_push_result testrepo $the_first_commit heads/second &&\n \t! check_push_result testrepo $the_first_commit heads/foo heads/bar\n '\n \n test_expect_success 'push --prune refspec' '\n-\tmk_test testrepo tmp/main tmp/second tmp/foo tmp/bar &&\n+\tmk_test testrepo tmp/main tmp/foo tmp/bar &&\n \tgit push --prune testrepo \"refs/heads/*:refs/tmp/*\" &&\n \tcheck_push_result testrepo $the_commit tmp/main &&\n-\tcheck_push_result testrepo $the_first_commit tmp/second &&\n \t! check_push_result testrepo $the_first_commit tmp/foo tmp/bar\n '\n \n\n-- \n2.48.1.321.gbf1f004a4a.dirty\n\n"},{"id":"511086","messageId":"xmqq1pwuwpx7.fsf@gitster.g","threadId":"62625","inReplyTo":"20250122-pks-remote-branches-deprecation-v4-5-5cbf5b28afd5@pks.im","subject":"Re: [PATCH v4 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-22T20:32:04Z","receivedAt":"2025-01-22T20:32:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> +\t\t  \"If you cannot, please let us know you still use it by sending an\\n\"\n> +\t\t  \"e-mail to <git@vger.kernel.org>.\"),\n> +\t\ttype, remote->name, remote->name, remote->name);\n> +}\n\nI do not think we want to receive a piece of e-mail that says they\nwant us to know they still use it.  I do not mind seeing one that\nsays WHY they cannot switch, though.\n\nIf there is no objection, let me do\n\n\t\"let us know you still\" -> \"let us know why you still\"\n\non top.\n\nI like the way this has been made into a helper function, without\ncausing sentence-logo that would have annoyed translators.\n\nThanks.  Will replace.\n\n"},{"id":"512832","messageId":"20250221152644.o5ni6vn6rncvmaq6@jwilk.net","threadId":"62625","inReplyTo":"20250122-pks-remote-branches-deprecation-v4-5-5cbf5b28afd5@pks.im","subject":"Re: [PATCH v4 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Jakub Wilk","fromEmail":"jwilk@jwilk.net","sentAt":"2025-02-21T15:26:44Z","receivedAt":"2025-02-21T15:35:19Z","isPatch":true,"sender":{"key":"jwilk@jwilk.net","avatar":"https://avatars.githubusercontent.com/u/141546?v=4"},"body":"* Patrick Steinhardt <ps@pks.im>, 2025-01-22 12:31:\n>+As our documentation mentions, these directories are not to be found in modern\n>+repositories at all and most users aren't even aware of these mechanisms. They\n\nThis isn't accurate. The \"branches/\" directory used to be part of the \ndefault template until very recently, so it's found all over the place \n(although most likely empty).\n\nI'd say: \"... these directories are unlikely to be used in modern \nrepositories and ...\"\n\n-- \nJakub Wilk\n"},{"id":"512842","messageId":"xmqqmsef9mm1.fsf@gitster.g","threadId":"62625","inReplyTo":"20250221152644.o5ni6vn6rncvmaq6@jwilk.net","subject":"Re: [PATCH v4 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-02-21T18:30:30Z","receivedAt":"2025-02-21T18:30:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Wilk <jwilk@jwilk.net> writes:\n\n> * Patrick Steinhardt <ps@pks.im>, 2025-01-22 12:31:\n>>+As our documentation mentions, these directories are not to be found in modern\n>>+repositories at all and most users aren't even aware of these mechanisms. They\n>\n> This isn't accurate. The \"branches/\" directory used to be part of the\n> default template until very recently, so it's found all over the place\n> (although most likely empty).\n>\n> I'd say: \"... these directories are unlikely to be used in modern\n> repositories and ...\"\n\nThat's a very careful reading.  Thanks for pointing out the\ndistinction between being found and being used.\n"},{"id":"512967","messageId":"Z714F8mLHZcoHptI@pks.im","threadId":"62625","inReplyTo":"xmqqmsef9mm1.fsf@gitster.g","subject":"Re: [PATCH v4 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-02-25T07:58:15Z","receivedAt":"2025-02-25T07:58:20Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Feb 21, 2025 at 10:30:30AM -0800, Junio C Hamano wrote:\n> Jakub Wilk <jwilk@jwilk.net> writes:\n> \n> > * Patrick Steinhardt <ps@pks.im>, 2025-01-22 12:31:\n> >>+As our documentation mentions, these directories are not to be found in modern\n> >>+repositories at all and most users aren't even aware of these mechanisms. They\n> >\n> > This isn't accurate. The \"branches/\" directory used to be part of the\n> > default template until very recently, so it's found all over the place\n> > (although most likely empty).\n> >\n> > I'd say: \"... these directories are unlikely to be used in modern\n> > repositories and ...\"\n> \n> That's a very careful reading.  Thanks for pointing out the\n> distinction between being found and being used.\n\nIndeed. Do you maybe want to send a patch for this? Otherwise I can\nhandle it for you.\n\nThanks!\n\nPatrick\n"},{"id":"513045","messageId":"xmqqcyf5io61.fsf@gitster.g","threadId":"62625","inReplyTo":"Z714F8mLHZcoHptI@pks.im","subject":"Re: [PATCH v4 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-02-25T23:45:42Z","receivedAt":"2025-02-25T23:45:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> On Fri, Feb 21, 2025 at 10:30:30AM -0800, Junio C Hamano wrote:\n>> Jakub Wilk <jwilk@jwilk.net> writes:\n>> \n>> > * Patrick Steinhardt <ps@pks.im>, 2025-01-22 12:31:\n>> >>+As our documentation mentions, these directories are not to be found in modern\n>> >>+repositories at all and most users aren't even aware of these mechanisms. They\n>> >\n>> > This isn't accurate. The \"branches/\" directory used to be part of the\n>> > default template until very recently, so it's found all over the place\n>> > (although most likely empty).\n>> >\n>> > I'd say: \"... these directories are unlikely to be used in modern\n>> > repositories and ...\"\n>> \n>> That's a very careful reading.  Thanks for pointing out the\n>> distinction between being found and being used.\n>\n> Indeed. Do you maybe want to send a patch for this? Otherwise I can\n> handle it for you.\n>\n> Thanks!\n>\n> Patrick\n\n--- >8 ---\nSubject: BreakingChanges: clarify branches/ and remotes/\n\nAs we have created an empty .git/branches/ hierarchy until fairly\nrecently, these directories may be found in modern repositories, but\nit is highly unlikely that they are being used.\n\nReported-by: Jakub Wilk <jwilk@jwilk.net>\nAcked-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/BreakingChanges.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git c/Documentation/BreakingChanges.txt w/Documentation/BreakingChanges.txt\nindex 7c388e56c8..042709a461 100644\n--- c/Documentation/BreakingChanges.txt\n+++ w/Documentation/BreakingChanges.txt\n@@ -169,8 +169,8 @@ started to migrate away from \".git/remotes/\" in favor of config-based remotes,\n and we have marked the directory as legacy in 3d3d282146 (Documentation:\n Grammar correction, wording fixes and cleanup, 2011-08-23)\n +\n-As our documentation mentions, these directories are not to be found in modern\n-repositories at all and most users aren't even aware of these mechanisms. They\n+As our documentation mentions, these directories are unlikely to be used in\n+modern repositories and most users aren't even aware of these mechanisms. They\n have been deprecated for almost 20 years and 14 years respectively, and we are\n not aware of any active users that have complained about this deprecation.\n Furthermore, the \".git/branches/\" directory is nowadays misleadingly named and\n"},{"id":"513072","messageId":"Z77dEqpX-NbUWICx@pks.im","threadId":"62625","inReplyTo":"xmqqcyf5io61.fsf@gitster.g","subject":"Re: [PATCH v4 5/5] remote: announce removal of \"branches/\" and \"remotes/\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-02-26T09:21:22Z","receivedAt":"2025-02-26T09:21:29Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Feb 25, 2025 at 03:45:42PM -0800, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> > On Fri, Feb 21, 2025 at 10:30:30AM -0800, Junio C Hamano wrote:\n> >> Jakub Wilk <jwilk@jwilk.net> writes:\n> >> \n> >> > * Patrick Steinhardt <ps@pks.im>, 2025-01-22 12:31:\n> >> >>+As our documentation mentions, these directories are not to be found in modern\n> >> >>+repositories at all and most users aren't even aware of these mechanisms. They\n> >> >\n> >> > This isn't accurate. The \"branches/\" directory used to be part of the\n> >> > default template until very recently, so it's found all over the place\n> >> > (although most likely empty).\n> >> >\n> >> > I'd say: \"... these directories are unlikely to be used in modern\n> >> > repositories and ...\"\n> >> \n> >> That's a very careful reading.  Thanks for pointing out the\n> >> distinction between being found and being used.\n> >\n> > Indeed. Do you maybe want to send a patch for this? Otherwise I can\n> > handle it for you.\n> >\n> > Thanks!\n> >\n> > Patrick\n\nAh, I didn't mean you, Junio, but Jakub. But anyway, thanks for sending\nthe patch!\n\n> --- >8 ---\n> Subject: BreakingChanges: clarify branches/ and remotes/\n> \n> As we have created an empty .git/branches/ hierarchy until fairly\n> recently, these directories may be found in modern repositories, but\n> it is highly unlikely that they are being used.\n> \n> Reported-by: Jakub Wilk <jwilk@jwilk.net>\n> Acked-by: Patrick Steinhardt <ps@pks.im>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  Documentation/BreakingChanges.txt | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git c/Documentation/BreakingChanges.txt w/Documentation/BreakingChanges.txt\n> index 7c388e56c8..042709a461 100644\n> --- c/Documentation/BreakingChanges.txt\n> +++ w/Documentation/BreakingChanges.txt\n> @@ -169,8 +169,8 @@ started to migrate away from \".git/remotes/\" in favor of config-based remotes,\n>  and we have marked the directory as legacy in 3d3d282146 (Documentation:\n>  Grammar correction, wording fixes and cleanup, 2011-08-23)\n>  +\n> -As our documentation mentions, these directories are not to be found in modern\n> -repositories at all and most users aren't even aware of these mechanisms. They\n> +As our documentation mentions, these directories are unlikely to be used in\n> +modern repositories and most users aren't even aware of these mechanisms. They\n>  have been deprecated for almost 20 years and 14 years respectively, and we are\n>  not aware of any active users that have complained about this deprecation.\n>  Furthermore, the \".git/branches/\" directory is nowadays misleadingly named and\n\nThe change looks great to me, thanks!\n\nPatrick\n"}]}