Re: [PATCH v2 5/5] remote: announce removal of "branches/" and "remotes/"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 7, 2025, 16:40 UTC
- Message-ID
- <xmqq8qrmvap5.fsf@gitster.g>
- In-Reply-To
- <Z30hnx43mEwjWqzA@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
> Makes sense indeed. We can easily add for something like below diff. > I'll roll that into the next version, thanks!
It is a good start, but is probably a bit too noisy. Can we make them appear ONLY when the definitions read from these older sources are actually USED?
Thanks.
Show 34 quoted lines
>
> Patrick
>
> diff --git a/remote.c b/remote.c
> index 55e91fab47..8c104c6ee1 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -309,6 +309,13 @@ static void read_remotes_file(struct remote_state *remote_state,
>
> if (!f)
> return;
> +
> + warning(_("Reading remote from \"remotes/%s\", which is nominated\n"
> + "for removal. If you still use the \"remotes/\" directory\n"
> + "it is recommended to migrate to config-based remotes. If\n"
> + "you cannot, please let us know you still use it by sending\n"
> + "an e-mail to <git@vger.kernel.org>."), remote->name);
> +
> remote->configured_in_repo = 1;
> remote->origin = REMOTE_REMOTES;
> while (strbuf_getline(&buf, f) != EOF) {
> @@ -338,6 +345,12 @@ static void read_branches_file(struct remote_state *remote_state,
> if (!f)
> return;
>
> + warning(_("Reading remote from \"branches/%s\", which is nominated\n"
> + "for removal. If you still use the \"branches/\" directory\n"
> + "it is recommended to migrate to config-based remotes. If\n"
> + "you cannot, please let us know you still use it by sending\n"
> + "an e-mail to <git@vger.kernel.org>."), remote->name);
> +
> strbuf_getline_lf(&buf, f);
> fclose(f);
> strbuf_trim(&buf);