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

Re: [PATCH 01/10] contrib: remove "remotes2config.sh"

From
Patrick Steinhardt <ps@pks.im>
Date
May 7, 2025, 06:27 UTC
Message-ID
<aBr9VuYurCCvRYnj@pks.im>
In-Reply-To
<xmqqr011ikjc.fsf@gitster.g>
On Tue, May 06, 2025 at 12:52:39PM -0700, Junio C Hamano wrote:
Show 34 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > Remotes can be configured either via a repository's config or by using
> > the ".git/branches/" or ".git/remotes/" directories. Back when the new
> > config-based mechanism has been introduced we also introduced a helper
> > script that migrates from the old-style remote configuration to the new
> > config-based mechanism.
> >
> > With the recent removal announcement for the two directories we also
> > started to instruct users to migrate repositories that still use these
> > mechanism to use config-based remotes. Notably though, the migration
> > path doesn't even use the migration script. Instead, git-remote(1)
> > itself knows how to migrate any such remote via `git remote rename`.
> 
> Makes sense.
> 
> This logically comes after your series, which ended at 8ccc75c2
> (remote: announce removal of "branches/" and "remotes/",
> 2025-01-22), lands.  After that, we can safely remove this script at
> the 3.0 boundary, at the same time we clean up the code paths that
> are conditionally compiled with WITH_BREAKING_CHANGES.
> 
> > Furthermore, the script hasn't been touched since afa75bc8aa1 (contrib:
> > Make remotes2config.sh script more robust, 2007-12-02).
> 
> A single-purpose thing that is done correctly on top of a right
> abstraction does not necessarily need further updates, so I doubt
> this paragraph contributes to the decision to remove the script in
> any way.
> 
> > Given that there is a migration path without this script it is very
> > unlikely that anyone still uses the script. Remove it.
> 
> Sounds good, but not right now, I presume?

I think it should be fine to remove it right now. If it was the canonical way to migrate repos to the new format we definitely shouldn't. But nowhere in our tree do we even point to this script, and the deprecation notice we have created explicitly tells users to use `git remote rename`:

    static void warn_about_deprecated_remote_type(const char *type,
                              const struct remote *remote)
    {
        warning(_("reading remote from \"%s/%s\", which is nominated for removal.\n"
              "\n"
              "If you still use the \"remotes/\" directory it is recommended to\n"
              "migrate to config-based remotes:\n"
              "\n"
              "\tgit remote rename %s %s\n"
              "\n"
              "If you cannot, please let us know why you still need to use it by\n"
              "sending an e-mail to <git@vger.kernel.org>."),
            type, remote->name, remote->name, remote->name);
    }

So I highly doubt this script plays any role in the migration towards config-based remotes. Also because the script only cares about the "remotes/" directory -- it doesn't even know to migrate remotes from "branches/".

Another data point: the script doesn't even work as-is, as it sources ". git-sh-setup". So for it to work it would need to be installed into "$prefix/libexec/git-core" together with our other tools, or it needs to be called so that "git-sh-setup" is in the user's PATH. Both of which seems quite unlikely to me.

All of this reasoning should of course go into the commit message.
Patrick
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 62 in “Spring cleanup of "contrib/"”
  1. 00/10 Spring cleanup of "contrib/"Patrick Steinhardt, May 6, 2025
  2. 02/10 contrib: remove "examples" directoryPatrick Steinhardt, May 6, 2025
  3. 01/10 contrib: remove "remotes2config.sh"Patrick Steinhardt, May 6, 2025
  4. Junio C HamanoMay 6, 2025
  5. Patrick SteinhardtMay 7, 2025
  6. Junio C HamanoMay 7, 2025
  7. 03/10 contrib: remove remote-helper stubsPatrick Steinhardt, May 6, 2025
  8. 04/10 contrib: remove "thunderbird-patch-inline"Patrick Steinhardt, May 6, 2025
  9. 05/10 contrib: remove "hooks" directoryPatrick Steinhardt, May 6, 2025
  10. 06/10 contrib: remove "mw-to-git"Patrick Steinhardt, May 6, 2025
  11. Junio C HamanoMay 6, 2025
  12. Matthieu MoyMay 7, 2025
  13. 08/10 contrib: remove "git-resurrect.sh"Patrick Steinhardt, May 6, 2025
  14. Junio C HamanoMay 6, 2025
  15. Patrick SteinhardtMay 7, 2025
  16. Junio C HamanoMay 7, 2025
  17. Kristoffer HaugsbakkMay 7, 2025
  18. 09/10 contrib: remove "emacs" directoryPatrick Steinhardt, May 6, 2025
  19. Junio C HamanoMay 6, 2025
  20. 07/10 contrib: remove "persistent-https" remote helperPatrick Steinhardt, May 6, 2025
  21. Junio C HamanoMay 6, 2025
  22. 10/10 contrib: remove "git-new-workdir"Patrick Steinhardt, May 6, 2025
  23. Junio C HamanoMay 6, 2025
  24. Patrick SteinhardtMay 7, 2025
  25. Junio C HamanoMay 7, 2025
  26. Patrick SteinhardtMay 9, 2025
  27. Junio C HamanoMay 6, 2025
  28. Eric SunshineMay 6, 2025
  29. Todd ZullingerMay 7, 2025
  30. Eric SunshineMay 7, 2025
  31. Patrick SteinhardtMay 7, 2025
  32. D. Ben KnobleMay 10, 2025
  33. Phillip WoodMay 12, 2025
  34. 00/11 Spring cleanup of "contrib/"Patrick Steinhardt, May 9, 2025
  35. 01/11 contrib: remove "remotes2config.sh"Patrick Steinhardt, May 9, 2025
  36. 02/11 contrib: remove "examples" directoryPatrick Steinhardt, May 9, 2025
  37. 03/11 contrib: remove remote-helper stubsPatrick Steinhardt, May 9, 2025
  38. 04/11 contrib: remove "thunderbird-patch-inline"Patrick Steinhardt, May 9, 2025
  39. 05/11 contrib: remove "hooks" directoryPatrick Steinhardt, May 9, 2025
  40. 06/11 contrib: remove "mw-to-git"Patrick Steinhardt, May 9, 2025
  41. 08/11 contrib: remove "git-resurrect.sh"Patrick Steinhardt, May 9, 2025
  42. 07/11 contrib: remove "persistent-https" remote helperPatrick Steinhardt, May 9, 2025
  43. 09/11 contrib: remove "emacs" directoryPatrick Steinhardt, May 9, 2025
  44. 10/11 contrib: remove "git-new-workdir"Patrick Steinhardt, May 9, 2025
  45. 11/11 contrib: remove "stats" directoryPatrick Steinhardt, May 9, 2025
  46. Elijah NewrenMay 9, 2025
  47. Elijah NewrenMay 9, 2025
  48. Junio C HamanoMay 10, 2025
  49. Patrick SteinhardtMay 12, 2025
  50. Collin FunkMay 12, 2025
  51. Phillip WoodMay 12, 2025
  52. Patrick SteinhardtMay 12, 2025
  53. Junio C HamanoMay 12, 2025
  54. Phillip WoodMay 14, 2025
  55. contrib: update thunderbird-patch-inlinePhillip Wood, May 16, 2025
  56. Kristoffer HaugsbakkMay 16, 2025
  57. Patrick SteinhardtMay 19, 2025
  58. Collin FunkMay 19, 2025
  59. Phillip WoodMay 19, 2025
  60. Junio C HamanoJun 3, 2025
  61. Junio C HamanoMay 19, 2025
  62. Peter KreftingMay 10, 2025

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.