Subject: Re: [PATCH v3 5/5] remote: announce removal of "branches/" and "remotes/"

From: Junio C Hamano <[email-masked]>
Date: Wed, 22 Jan 2025 09:58:23 -0800

Patrick Steinhardt <[email-masked]> writes:

> On Tue, Jan 21, 2025 at 01:25:56PM -0800, Junio C Hamano wrote:
>> Patrick Steinhardt <[email-masked]> writes:
>> > diff --git a/builtin/remote.c b/builtin/remote.c
>> > index 1ad3e70a6b..e565b2b3fe 100644
>> > --- a/builtin/remote.c
>> > +++ b/builtin/remote.c
>> > @@ -640,10 +640,12 @@ static int migrate_file(struct remote *remote)
>> >  	strbuf_addf(&buf, "remote.%s.fetch", remote->name);
>> >  	for (i = 0; i < remote->fetch.nr; i++)
>> >  		git_config_set_multivar(buf.buf, remote->fetch.items[i].raw, "^$", 0);
>> > +#ifndef WITH_BREAKING_CHANGES
>> >  	if (remote->origin == REMOTE_REMOTES)
>> >  		unlink_or_warn(git_path("remotes/%s", remote->name));
>> >  	else if (remote->origin == REMOTE_BRANCHES)
>> >  		unlink_or_warn(git_path("branches/%s", remote->name));
>> > +#endif /* WITH_BREAKING_CHANGES */
>> >  	strbuf_release(&buf);
>> 
>> Interesting.  I wonder if our new warning should talk about whatever
>> end-user facing interface that triggers this code path.  It would
>> help them wean themselves away from the old interface, no?
>
> Not quite sure that I understand what you're saying. Is it that we
> should tell whether we were reading from "branches/" or "remotes/"? If
> so we already do that.

No, what I meant was to say "You are using outdated remotes/
hierarchy to describe this remote.  You can run 'remote mv %s %s'
to migrate its definition to the more modern config-based system".

The message already says the first sentence, but not the latter.