All of lore.kernel.org
 help / color / mirror / Atom feed
From: <rsbecker@nexbridge.com>
To: "'Junio C Hamano'" <gitster@pobox.com>,
	"'Patrick Steinhardt'" <ps@pks.im>
Cc: "'Christian Couder'" <christian.couder@gmail.com>,
	<git@vger.kernel.org>, "'D. Ben Knoble'" <ben.knoble@gmail.com>
Subject: RE: [PATCH v2 5/5] remote: announce removal of "branches/" and "remotes/"
Date: Tue, 7 Jan 2025 11:55:16 -0500	[thread overview]
Message-ID: <006701db6124$f16f9420$d44ebc60$@nexbridge.com> (raw)
In-Reply-To: <xmqq4j2avaam.fsf@gitster.g>

On January 7, 2025 11:50 AM, Junio C Hamano wrote:
>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
>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
>*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,
> 		   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,
>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.


  reply	other threads:[~2025-01-07 16:55 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11 10:56 [PATCH 0/5] remote: announce removal of "branches/" and "remotes/" Patrick Steinhardt
2024-12-11 10:56 ` [PATCH 1/5] Makefile: wire up build option for deprecated features Patrick Steinhardt
2024-12-11 13:06   ` Kristoffer Haugsbakk
2024-12-13  5:26     ` Patrick Steinhardt
2024-12-11 10:56 ` [PATCH 2/5] ci: merge linux-gcc-default into linux-gcc Patrick Steinhardt
2024-12-11 10:56 ` [PATCH 3/5] ci: repurpose "linux-gcc" job for deprecations Patrick Steinhardt
2024-12-11 10:56 ` [PATCH 4/5] builtin/pack-redundant: remove subcommand with breaking changes Patrick Steinhardt
2024-12-11 10:56 ` [PATCH 5/5] remote: announce removal of "branches/" and "remotes/" Patrick Steinhardt
2025-01-06  7:51 ` [PATCH v2 0/5] " Patrick Steinhardt
2025-01-06  7:51   ` [PATCH v2 1/5] Makefile: wire up build option for deprecated features Patrick Steinhardt
2025-01-06 13:20     ` Christian Couder
2025-01-06 13:20       ` Christian Couder
2025-01-06  7:51   ` [PATCH v2 2/5] ci: merge linux-gcc-default into linux-gcc Patrick Steinhardt
2025-01-06 13:25     ` Christian Couder
2025-01-06 15:51       ` Junio C Hamano
2025-01-07 12:48       ` Patrick Steinhardt
2025-01-07 13:54         ` Christian Couder
2025-01-06  7:51   ` [PATCH v2 3/5] ci: repurpose "linux-gcc" job for deprecations Patrick Steinhardt
2025-01-06  7:51   ` [PATCH v2 4/5] builtin/pack-redundant: remove subcommand with breaking changes Patrick Steinhardt
2025-01-06  7:51   ` [PATCH v2 5/5] remote: announce removal of "branches/" and "remotes/" Patrick Steinhardt
2025-01-06 13:24     ` Christian Couder
2025-01-06 15:53       ` Junio C Hamano
2025-01-07 12:48         ` Patrick Steinhardt
2025-01-07 16:40           ` Junio C Hamano
2025-01-07 16:49             ` Junio C Hamano
2025-01-07 16:55               ` rsbecker [this message]
2025-01-08  6:36                 ` Patrick Steinhardt
2025-01-08 17:09                   ` Junio C Hamano
2025-01-09 10:06                     ` Patrick Steinhardt
2025-01-09 12:08                   ` Robert Coup
2025-01-09 10:20               ` Patrick Steinhardt
2025-01-09 15:54                 ` Junio C Hamano
2025-01-06 15:42   ` [PATCH v2 0/5] " Junio C Hamano
2025-01-07 12:48     ` Patrick Steinhardt
2025-01-07 16:36       ` Junio C Hamano
2025-01-20  7:42 ` [PATCH v3 " Patrick Steinhardt
2025-01-20  7:42   ` [PATCH v3 1/5] Makefile: wire up build option for deprecated features Patrick Steinhardt
2025-01-20  7:42   ` [PATCH v3 2/5] ci: merge linux-gcc-default into linux-gcc Patrick Steinhardt
2025-01-20  7:43   ` [PATCH v3 3/5] ci: repurpose "linux-gcc" job for deprecations Patrick Steinhardt
2025-01-20  7:43   ` [PATCH v3 4/5] builtin/pack-redundant: remove subcommand with breaking changes Patrick Steinhardt
2025-01-21 21:09     ` Junio C Hamano
2025-01-20  7:43   ` [PATCH v3 5/5] remote: announce removal of "branches/" and "remotes/" Patrick Steinhardt
2025-01-21 21:25     ` Junio C Hamano
2025-01-22 11:05       ` Patrick Steinhardt
2025-01-22 17:58         ` Junio C Hamano
2025-01-22 11:31 ` [PATCH v4 0/5] " Patrick Steinhardt
2025-01-22 11:31   ` [PATCH v4 1/5] Makefile: wire up build option for deprecated features Patrick Steinhardt
2025-01-22 11:31   ` [PATCH v4 2/5] ci: merge linux-gcc-default into linux-gcc Patrick Steinhardt
2025-01-22 11:31   ` [PATCH v4 3/5] ci: repurpose "linux-gcc" job for deprecations Patrick Steinhardt
2025-01-22 11:31   ` [PATCH v4 4/5] builtin/pack-redundant: remove subcommand with breaking changes Patrick Steinhardt
2025-01-22 11:31   ` [PATCH v4 5/5] remote: announce removal of "branches/" and "remotes/" Patrick Steinhardt
2025-01-22 20:32     ` Junio C Hamano
2025-02-21 15:26     ` Jakub Wilk
2025-02-21 18:30       ` Junio C Hamano
2025-02-25  7:58         ` Patrick Steinhardt
2025-02-25 23:45           ` Junio C Hamano
2025-02-26  9:21             ` Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='006701db6124$f16f9420$d44ebc60$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=ben.knoble@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.