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

RE: [PATCH v2 5/5] remote: announce removal of "branches/" and "remotes/"

From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
Date
Jan 7, 2025, 16:55 UTC
Message-ID
<006701db6124$f16f9420$d44ebc60$@nexbridge.com>
In-Reply-To
<xmqq4j2avaam.fsf@gitster.g>
On January 7, 2025 11:50 AM, Junio C Hamano wrote:
Show 14 quoted lines
>Junio C Hamano <gitster@pobox.com> writes:
>
>> 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.
>
>Something along this line is what I had in mind.  Not even compile tested,
and I am
>not claiming that all the uses of remote will go thourgh the code paths to
use it with
Show 12 quoted lines
>a transport, but you hopefully got the idea.
>
> remote.c    | 20 ++++++++++++++++++++
> remote.h    |  2 ++
> transport.c |  2 ++
> 3 files changed, 24 insertions(+)
>
>diff --git c/remote.c w/remote.c
>index f43cf5e7a4..1cca98215d 100644
>--- c/remote.c
>+++ w/remote.c
>@@ -2904,3 +2904,23 @@ char *relative_url(const char *remote_url, const
char
Show 29 quoted lines
>*url,
> 	free(out);
> 	return strbuf_detach(&sb, NULL);
> }
>+
>+void remote_stale_warning(const struct remote *remote) {
>+	const char *msg;
>+
>+	switch (remote->origin) {
>+	case REMOTE_REMOTES:
>+		msg = N_("Using remote '%s' read from the .git/remotes, "
>+			 "whose support will be removed");
>+		break;
>+	case REMOTE_BRANCHES:
>+		msg = N_("Using remote '%s' read from the .git/branches, "
>+			 "whose support will be removed");
>+		break;
>+	default:
>+		return;
>+	}
>+
>+	warning(_(msg), remote->name);
>+}
>diff --git c/remote.h w/remote.h
>index b901b56746..e29ceef3e4 100644
>--- c/remote.h
>+++ w/remote.h
>@@ -445,4 +445,6 @@ void apply_push_cas(struct push_cas_option *, struct
>remote *, struct ref *);  char *relative_url(const char *remote_url, const
char *url,
Show 10 quoted lines
> 		   const char *up_path);
>
>+void remote_stale_warning(const struct remote *remote);
>+
> #endif
>diff --git c/transport.c w/transport.c
>index 12cc5b4d96..c153be9100 100644
>--- c/transport.c
>+++ w/transport.c
>@@ -1131,6 +1131,8 @@ struct transport *transport_get(struct remote
*remote,
Show 9 quoted lines
>const char *url)
> 	ret->remote = remote;
> 	helper = remote->foreign_vcs;
>
>+	remote_stale_warning(remote);
>+
> 	if (!url)
> 		url = remote->url.v[0];
> 	ret->url = url;

I like this but wonder whether there might be some way to inhibit the warnings one a user gets it and decides they will act but do not want to see the warnings any longer? I have had requests like this on other products. Just a thought.

Previous: Junio C HamanoNext: Patrick Steinhardt
Message 26 of 47 in “remote: announce removal of "branches/" and "remotes/"”
  1. 0/5 remote: announce removal of "branches/" and "remotes/"Patrick Steinhardt, Dec 11, 2024
  2. 1/5 Makefile: wire up build option for deprecated featuresPatrick Steinhardt, Dec 11, 2024
  3. Kristoffer HaugsbakkDec 11, 2024
  4. Patrick SteinhardtDec 13, 2024
  5. 2/5 ci: merge linux-gcc-default into linux-gccPatrick Steinhardt, Dec 11, 2024
  6. 3/5 ci: repurpose "linux-gcc" job for deprecationsPatrick Steinhardt, Dec 11, 2024
  7. 4/5 builtin/pack-redundant: remove subcommand with breaking changesPatrick Steinhardt, Dec 11, 2024
  8. 5/5 remote: announce removal of "branches/" and "remotes/"Patrick Steinhardt, Dec 11, 2024
  9. 0/5 remote: announce removal of "branches/" and "remotes/"Patrick Steinhardt, Jan 6, 2025
  10. 1/5 Makefile: wire up build option for deprecated featuresPatrick Steinhardt, Jan 6, 2025
  11. Christian CouderJan 6, 2025
  12. Christian CouderJan 6, 2025
  13. 2/5 ci: merge linux-gcc-default into linux-gccPatrick Steinhardt, Jan 6, 2025
  14. Christian CouderJan 6, 2025
  15. Junio C HamanoJan 6, 2025
  16. Patrick SteinhardtJan 7, 2025
  17. Christian CouderJan 7, 2025
  18. 3/5 ci: repurpose "linux-gcc" job for deprecationsPatrick Steinhardt, Jan 6, 2025
  19. 4/5 builtin/pack-redundant: remove subcommand with breaking changesPatrick Steinhardt, Jan 6, 2025
  20. 5/5 remote: announce removal of "branches/" and "remotes/"Patrick Steinhardt, Jan 6, 2025
  21. Christian CouderJan 6, 2025
  22. Junio C HamanoJan 6, 2025
  23. Patrick SteinhardtJan 7, 2025
  24. Junio C HamanoJan 7, 2025
  25. Junio C HamanoJan 7, 2025
  26. rsbecker@nexbridge.comJan 7, 2025
  27. Patrick SteinhardtJan 8, 2025
  28. Junio C HamanoJan 8, 2025
  29. Patrick SteinhardtJan 9, 2025
  30. Robert CoupJan 9, 2025
  31. Patrick SteinhardtJan 9, 2025
  32. Junio C HamanoJan 9, 2025
  33. Junio C HamanoJan 6, 2025
  34. Patrick SteinhardtJan 7, 2025
  35. Junio C HamanoJan 7, 2025
  36. 0/5 remote: announce removal of "branches/" and "remotes/"Patrick Steinhardt, Jan 22, 2025
  37. 1/5 Makefile: wire up build option for deprecated featuresPatrick Steinhardt, Jan 22, 2025
  38. 2/5 ci: merge linux-gcc-default into linux-gccPatrick Steinhardt, Jan 22, 2025
  39. 3/5 ci: repurpose "linux-gcc" job for deprecationsPatrick Steinhardt, Jan 22, 2025
  40. 4/5 builtin/pack-redundant: remove subcommand with breaking changesPatrick Steinhardt, Jan 22, 2025
  41. 5/5 remote: announce removal of "branches/" and "remotes/"Patrick Steinhardt, Jan 22, 2025
  42. Junio C HamanoJan 22, 2025
  43. Jakub WilkFeb 21, 2025
  44. Junio C HamanoFeb 21, 2025
  45. Patrick SteinhardtFeb 25, 2025
  46. Junio C HamanoFeb 25, 2025
  47. Patrick SteinhardtFeb 26, 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.