git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 00/11] Start retiring .git/remotes/ and .git/branches/ for good

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 11, 2017, 13:47 UTC
Message-ID
<cover.1494509599.git.johannes.schindelin@gmx.de>

Git uses the config for remote/upstream information in favor of the previously-used .git/remotes/ and .git/branches/ for a decade now.

Nothing in Git writes to these files any longer, and the most prominent user of .git/branches/ (Cogito) is long abandoned.

It is time to start not only deprecating this feature, but *really* deprecating it. Like, really, *really*. For reals.

Half of this patch series does that.

The second half is a preview of the patches to finally rip out the code that implements .git/remotes/ & .git/branches/ support. We we will want to apply them to a future major version of Git, after *really* deprecating .git/remotes/ & .git/branches/ support for at least one major version (I would be more comfortable with three major versions, actually).

Note: even after these patches, there is still a file mentioning
.git/remote/ (sic!) and .git/branches/:
Documentation/git-show-branch.txt. The reference is not, however,
describing Git's internals, but merely uses existing commit history
(from the olden days) in an example.

There is also a reference in contrib/examples/git-fetch.sh, but that should remain there, for historians' purposes.

Oh, and the reason that I split out the changes to t5505, t5510, t5515 & t5516 in the PREVIEW part is that those changes are unfortunately not quite as trivial as I hoped, and require a bit of a rationale for the way they were performed in the commit message. Read: I wanted to make this patch series easier to review. And as I already split out all the t/ patches, it felt silly to *not* split out the t0060 patch.

Johannes Schindelin (11):
  git-parse-remote: fix highly misleading man page
  Documentation: really deprecate .git/remotes/ and .git/branches/
  remote: warn loud and clear when .git/branches/ is *still* used
  remote: warn loud and clear when .git/remotes/ is *still* used
  Revert "Revert "Don't create the $GIT_DIR/branches directory on init""
  PREVIEW: t5510: convert .git/remotes/ test to use a regular remote
  PREVIEW: t5516: stop testing .git/branches/ functionality
  PREVIEW: remote: remove support for migrating ancient remotes
  PREVIEW: t5515: remove .git/remotes/ and .git/branches/ tests
  PREVIEW: t0060: stop testing support for .git/remotes/ and
    .git/branches/
  PREVIEW: remove support for .git/remotes/ and .git/branches/
 Documentation/git-parse-remote.txt                 |  7 +-
 Documentation/git-remote.txt                       |  4 -
 Documentation/gitrepository-layout.txt             | 19 +++--
 Documentation/urls-remotes.txt                     | 65 +---------------
 builtin/remote.c                                   | 27 -------
 path.c                                             |  2 -
 remote.c                                           | 89 ----------------------
 remote.h                                           |  4 +-
 t/t0060-path-utils.sh                              |  2 -
 t/t5505-remote.sh                                  | 55 -------------
 t/t5510-fetch.sh                                   | 10 +--
 t/t5515-fetch-merge-logic.sh                       | 23 ------
 t/t5515/fetch.br-branches-default                  |  8 --
 t/t5515/fetch.br-branches-default-merge            |  9 ---
 ...etch.br-branches-default-merge_branches-default |  9 ---
 t/t5515/fetch.br-branches-default-octopus          | 10 ---
 ...ch.br-branches-default-octopus_branches-default | 10 ---
 t/t5515/fetch.br-branches-default_branches-default |  8 --
 t/t5515/fetch.br-branches-one                      |  8 --
 t/t5515/fetch.br-branches-one-merge                |  9 ---
 t/t5515/fetch.br-branches-one-merge_branches-one   |  9 ---
 t/t5515/fetch.br-branches-one-octopus              |  9 ---
 t/t5515/fetch.br-branches-one-octopus_branches-one |  9 ---
 t/t5515/fetch.br-branches-one_branches-one         |  8 --
 t/t5515/fetch.br-remote-explicit                   | 11 ---
 t/t5515/fetch.br-remote-explicit-merge             | 11 ---
 .../fetch.br-remote-explicit-merge_remote-explicit | 11 ---
 t/t5515/fetch.br-remote-explicit-octopus           | 11 ---
 ...etch.br-remote-explicit-octopus_remote-explicit | 11 ---
 t/t5515/fetch.br-remote-explicit_remote-explicit   | 11 ---
 t/t5515/fetch.br-remote-glob                       | 11 ---
 t/t5515/fetch.br-remote-glob-merge                 | 11 ---
 t/t5515/fetch.br-remote-glob-merge_remote-glob     | 11 ---
 t/t5515/fetch.br-remote-glob-octopus               | 11 ---
 t/t5515/fetch.br-remote-glob-octopus_remote-glob   | 11 ---
 t/t5515/fetch.br-remote-glob_remote-glob           | 11 ---
 t/t5515/fetch.br-unconfig_branches-default         |  8 --
 t/t5515/fetch.br-unconfig_branches-one             |  8 --
 t/t5515/fetch.br-unconfig_remote-explicit          | 11 ---
 t/t5515/fetch.br-unconfig_remote-glob              | 11 ---
 t/t5515/fetch.master_branches-default              |  8 --
 t/t5515/fetch.master_branches-one                  |  8 --
 t/t5515/fetch.master_remote-explicit               | 11 ---
 t/t5515/fetch.master_remote-glob                   | 11 ---
 t/t5515/refs.br-branches-default                   | 12 ---
 t/t5515/refs.br-branches-default-merge             | 12 ---
 ...refs.br-branches-default-merge_branches-default | 12 ---
 t/t5515/refs.br-branches-default-octopus           | 12 ---
 ...fs.br-branches-default-octopus_branches-default | 12 ---
 t/t5515/refs.br-branches-default_branches-default  | 12 ---
 t/t5515/refs.br-branches-one                       | 12 ---
 t/t5515/refs.br-branches-one-merge                 | 12 ---
 t/t5515/refs.br-branches-one-merge_branches-one    | 12 ---
 t/t5515/refs.br-branches-one-octopus               | 12 ---
 t/t5515/refs.br-branches-one-octopus_branches-one  | 12 ---
 t/t5515/refs.br-branches-one_branches-one          | 12 ---
 t/t5515/refs.br-remote-explicit                    | 15 ----
 t/t5515/refs.br-remote-explicit-merge              | 15 ----
 .../refs.br-remote-explicit-merge_remote-explicit  | 15 ----
 t/t5515/refs.br-remote-explicit-octopus            | 15 ----
 ...refs.br-remote-explicit-octopus_remote-explicit | 15 ----
 t/t5515/refs.br-remote-explicit_remote-explicit    | 15 ----
 t/t5515/refs.br-remote-glob                        | 15 ----
 t/t5515/refs.br-remote-glob-merge                  | 15 ----
 t/t5515/refs.br-remote-glob-merge_remote-glob      | 15 ----
 t/t5515/refs.br-remote-glob-octopus                | 15 ----
 t/t5515/refs.br-remote-glob-octopus_remote-glob    | 15 ----
 t/t5515/refs.br-remote-glob_remote-glob            | 15 ----
 t/t5515/refs.br-unconfig_branches-default          | 12 ---
 t/t5515/refs.br-unconfig_branches-one              | 12 ---
 t/t5515/refs.br-unconfig_remote-explicit           | 15 ----
 t/t5515/refs.br-unconfig_remote-glob               | 15 ----
 t/t5515/refs.master_branches-default               | 12 ---
 t/t5515/refs.master_branches-one                   | 12 ---
 t/t5515/refs.master_remote-explicit                | 15 ----
 t/t5515/refs.master_remote-glob                    | 15 ----
 t/t5516-fetch-push.sh                              | 55 +------------
 templates/branches--                               |  1 -
 78 files changed, 20 insertions(+), 1089 deletions(-)
 delete mode 100644 t/t5515/fetch.br-branches-default
 delete mode 100644 t/t5515/fetch.br-branches-default-merge
 delete mode 100644 t/t5515/fetch.br-branches-default-merge_branches-default
 delete mode 100644 t/t5515/fetch.br-branches-default-octopus
 delete mode 100644 t/t5515/fetch.br-branches-default-octopus_branches-default
 delete mode 100644 t/t5515/fetch.br-branches-default_branches-default
 delete mode 100644 t/t5515/fetch.br-branches-one
 delete mode 100644 t/t5515/fetch.br-branches-one-merge
 delete mode 100644 t/t5515/fetch.br-branches-one-merge_branches-one
 delete mode 100644 t/t5515/fetch.br-branches-one-octopus
 delete mode 100644 t/t5515/fetch.br-branches-one-octopus_branches-one
 delete mode 100644 t/t5515/fetch.br-branches-one_branches-one
 delete mode 100644 t/t5515/fetch.br-remote-explicit
 delete mode 100644 t/t5515/fetch.br-remote-explicit-merge
 delete mode 100644 t/t5515/fetch.br-remote-explicit-merge_remote-explicit
 delete mode 100644 t/t5515/fetch.br-remote-explicit-octopus
 delete mode 100644 t/t5515/fetch.br-remote-explicit-octopus_remote-explicit
 delete mode 100644 t/t5515/fetch.br-remote-explicit_remote-explicit
 delete mode 100644 t/t5515/fetch.br-remote-glob
 delete mode 100644 t/t5515/fetch.br-remote-glob-merge
 delete mode 100644 t/t5515/fetch.br-remote-glob-merge_remote-glob
 delete mode 100644 t/t5515/fetch.br-remote-glob-octopus
 delete mode 100644 t/t5515/fetch.br-remote-glob-octopus_remote-glob
 delete mode 100644 t/t5515/fetch.br-remote-glob_remote-glob
 delete mode 100644 t/t5515/fetch.br-unconfig_branches-default
 delete mode 100644 t/t5515/fetch.br-unconfig_branches-one
 delete mode 100644 t/t5515/fetch.br-unconfig_remote-explicit
 delete mode 100644 t/t5515/fetch.br-unconfig_remote-glob
 delete mode 100644 t/t5515/fetch.master_branches-default
 delete mode 100644 t/t5515/fetch.master_branches-one
 delete mode 100644 t/t5515/fetch.master_remote-explicit
 delete mode 100644 t/t5515/fetch.master_remote-glob
 delete mode 100644 t/t5515/refs.br-branches-default
 delete mode 100644 t/t5515/refs.br-branches-default-merge
 delete mode 100644 t/t5515/refs.br-branches-default-merge_branches-default
 delete mode 100644 t/t5515/refs.br-branches-default-octopus
 delete mode 100644 t/t5515/refs.br-branches-default-octopus_branches-default
 delete mode 100644 t/t5515/refs.br-branches-default_branches-default
 delete mode 100644 t/t5515/refs.br-branches-one
 delete mode 100644 t/t5515/refs.br-branches-one-merge
 delete mode 100644 t/t5515/refs.br-branches-one-merge_branches-one
 delete mode 100644 t/t5515/refs.br-branches-one-octopus
 delete mode 100644 t/t5515/refs.br-branches-one-octopus_branches-one
 delete mode 100644 t/t5515/refs.br-branches-one_branches-one
 delete mode 100644 t/t5515/refs.br-remote-explicit
 delete mode 100644 t/t5515/refs.br-remote-explicit-merge
 delete mode 100644 t/t5515/refs.br-remote-explicit-merge_remote-explicit
 delete mode 100644 t/t5515/refs.br-remote-explicit-octopus
 delete mode 100644 t/t5515/refs.br-remote-explicit-octopus_remote-explicit
 delete mode 100644 t/t5515/refs.br-remote-explicit_remote-explicit
 delete mode 100644 t/t5515/refs.br-remote-glob
 delete mode 100644 t/t5515/refs.br-remote-glob-merge
 delete mode 100644 t/t5515/refs.br-remote-glob-merge_remote-glob
 delete mode 100644 t/t5515/refs.br-remote-glob-octopus
 delete mode 100644 t/t5515/refs.br-remote-glob-octopus_remote-glob
 delete mode 100644 t/t5515/refs.br-remote-glob_remote-glob
 delete mode 100644 t/t5515/refs.br-unconfig_branches-default
 delete mode 100644 t/t5515/refs.br-unconfig_branches-one
 delete mode 100644 t/t5515/refs.br-unconfig_remote-explicit
 delete mode 100644 t/t5515/refs.br-unconfig_remote-glob
 delete mode 100644 t/t5515/refs.master_branches-default
 delete mode 100644 t/t5515/refs.master_branches-one
 delete mode 100644 t/t5515/refs.master_remote-explicit
 delete mode 100644 t/t5515/refs.master_remote-glob
 delete mode 100644 templates/branches--
base-commit: b06d3643105c8758ed019125a4399cb7efdcce2c
Published-As: https://github.com/dscho/git/releases/tag/retire-cogito-branches-v1
Fetch-It-Via: git fetch https://github.com/dscho/git retire-cogito-branches-v1
-- 
2.12.2.windows.2.800.gede8f145e06
Next: Johannes Schindelin
Message 1 of 62 in “Start retiring .git/remotes/ and .git/branches/ for good”
  1. 00/11 Start retiring .git/remotes/ and .git/branches/ for goodJohannes Schindelin, May 11, 2017
  2. 05/11 Revert "Revert "Don't create the $GIT_DIR/branches directory on init""Johannes Schindelin, May 11, 2017
  3. Stefan BellerMay 11, 2017
  4. 04/11 remote: warn loud and clear when .git/remotes/ is *still* usedJohannes Schindelin, May 11, 2017
  5. 01/11 git-parse-remote: fix highly misleading man pageJohannes Schindelin, May 11, 2017
  6. Stefan BellerMay 11, 2017
  7. Johannes SchindelinMay 11, 2017
  8. 0/5 Remove now-unused git-parse-remoteÆvar Arnfjörð Bjarmason, Nov 11, 2020
  9. Jeff KingNov 11, 2020
  10. Junio C HamanoNov 11, 2020
  11. Ævar Arnfjörð BjarmasonNov 12, 2020
  12. Jeff KingNov 12, 2020
  13. How do I "git fetch" with a custom <refspec> but a default remote?Ævar Arnfjörð Bjarmason, Nov 12, 2020
  14. Jeff KingNov 12, 2020
  15. Chris TorekNov 12, 2020
  16. Jeff KingNov 12, 2020
  17. Junio C HamanoNov 12, 2020
  18. Ævar Arnfjörð BjarmasonNov 14, 2020
  19. 1/5 parse-remote: remove unused GIT_DIR variableÆvar Arnfjörð Bjarmason, Nov 11, 2020
  20. 2/5 parse-remote: remove long-dead rebase codeÆvar Arnfjörð Bjarmason, Nov 11, 2020
  21. 4/5 parse-remote: move used code to git-submodule.shÆvar Arnfjörð Bjarmason, Nov 11, 2020
  22. 5/5 parse-remote: remove this now-unused libraryÆvar Arnfjörð Bjarmason, Nov 11, 2020
  23. Junio C HamanoNov 11, 2020
  24. 0/2 Retire git-parse-remoteJunio C Hamano, Nov 12, 2020
  25. 1/2 parse-remote: move used code to git-submodule.shJunio C Hamano, Nov 12, 2020
  26. 2/2 parse-remote: remove this now-unused libraryJunio C Hamano, Nov 12, 2020
  27. Jeff KingNov 12, 2020
  28. Junio C HamanoNov 12, 2020
  29. Ævar Arnfjörð BjarmasonNov 13, 2020
  30. 0/3 submodule sh->C & retire parse-remoteÆvar Arnfjörð Bjarmason, Nov 14, 2020
  31. 1/3 submodule: use "fetch" logic instead of custom remote discoveryÆvar Arnfjörð Bjarmason, Nov 14, 2020
  32. Junio C HamanoNov 16, 2020
  33. 3/3 parse-remote: remove this now-unused libraryÆvar Arnfjörð Bjarmason, Nov 14, 2020
  34. Junio C HamanoNov 16, 2020
  35. Ævar Arnfjörð BjarmasonNov 17, 2020
  36. 2/3 submodule: remove sh function in favor of helperÆvar Arnfjörð Bjarmason, Nov 14, 2020
  37. 3/5 parse-remote: remove long-dead git-pull.sh codeÆvar Arnfjörð Bjarmason, Nov 11, 2020
  38. 03/11 remote: warn loud and clear when .git/branches/ is *still* usedJohannes Schindelin, May 11, 2017
  39. 09/11 PREVIEW: t5515: remove .git/remotes/ and .git/branches/ testsJohannes Schindelin, May 11, 2017
  40. 02/11 Documentation: really deprecate .git/remotes/ and .git/branches/Johannes Schindelin, May 11, 2017
  41. 10/11 PREVIEW: t0060: stop testing support for .git/remotes/ and .git/branches/Johannes Schindelin, May 11, 2017
  42. 11/11 PREVIEW: remove support for .git/remotes/ and .git/branches/Johannes Schindelin, May 11, 2017
  43. Stefan BellerMay 11, 2017
  44. Johannes SchindelinMay 11, 2017
  45. 06/11 PREVIEW: t5510: convert .git/remotes/ test to use a regular remoteJohannes Schindelin, May 11, 2017
  46. 07/11 PREVIEW: t5516: stop testing .git/branches/ functionalityJohannes Schindelin, May 11, 2017
  47. 08/11 PREVIEW: remote: remove support for migrating ancient remotesJohannes Schindelin, May 11, 2017
  48. Junio C HamanoMay 12, 2017
  49. Johannes SchindelinMay 12, 2017
  50. Junio C HamanoMay 16, 2017
  51. Ævar Arnfjörð BjarmasonMay 16, 2017
  52. Junio C HamanoMay 16, 2017
  53. Ævar Arnfjörð BjarmasonMay 16, 2017
  54. Junio C HamanoMay 17, 2017
  55. Junio C HamanoMay 12, 2017
  56. Johannes SchindelinMay 12, 2017
  57. Jonathan NiederMay 12, 2017
  58. Junio C HamanoMay 13, 2017
  59. Junio C HamanoMay 12, 2017
  60. Johannes SchindelinMay 15, 2017
  61. Jeff KingMay 12, 2017
  62. Johannes SchindelinMay 12, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.