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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 06, 2025 at 07:53:46AM -0800, Junio C Hamano wrote:
> Christian Couder <christian.couder@xxxxxxxxx> writes:
> 
> > What I like about the removal of git-pack-redundant(1) in the previous
> > patch is that we started to emit a user-visible warning in 2020 and
> > now users even have to pass an `--i-still-use-this` option to be able
> > to use the command. This really makes sure users cannot ignore the
> > fact that the command is deprecated.
> >
> > Accordingly I think it would be nice if we started to emit warnings
> > (that could possibly be disabled) when we find a repo still uses stuff
> > in "branches/" and "remotes/". These would be much more difficult to
> > miss or ignore than doc changes.
> 
> That's an excellent suggestion.  Even though this topic is about
> introducing breaking changes, saying "we waited for long enough",
> making sure we have prepared the user base for such changes to
> lesson the impact of "breaking" changes is a very prudent thing to
> do.
> 
> I guess everything is contained within remote.c these days?
> Patches welcome ;-)

Makes sense indeed. We can easily add for something like below diff.
I'll roll that into the next version, thanks!

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@xxxxxxxxxxxxxxx>."), 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@xxxxxxxxxxxxxxx>."), remote->name);
+
 	strbuf_getline_lf(&buf, f);
 	fclose(f);
 	strbuf_trim(&buf);





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux