{"thread":{"id":"56965","subject":"[RFC PATCH] Makefile: add deprecation message for strip target","startedAt":"2021-11-23T12:29:50Z","lastAt":"2021-11-23T13:07:13Z","messageCount":2,"participants":["Bagas Sanjaya","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"442141","messageId":"20211123122934.639428-1-bagasdotme@gmail.com","threadId":"56965","inReplyTo":null,"subject":"[RFC PATCH] Makefile: add deprecation message for strip target","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-11-23T12:29:33Z","receivedAt":"2021-11-23T12:29:50Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"Now that $INSTALL_STRIP variable can be defined since 3231f41009 (make:\nadd INSTALL_STRIP option variable, 2021-09-05), deprecate 'strip' target\nto encourage users to move to $INSTALL_STRIP. The target will eventually\nbe removed in Git 2.35+1.\n\nOnly deprecation message is printed.\n\nSigned-off-by: Bagas Sanjaya <bagasdotme@gmail.com>\n---\n Makefile | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex 12be39ac49..ee83860f7d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2159,6 +2159,8 @@ please_set_SHELL_PATH_to_a_more_modern_shell:\n shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell\n \n strip: $(PROGRAMS) git$X\n+\t@echo \"The 'strip' target is deprecated, define INSTALL_STRIP if you want to\"\n+\t@echo \"install Git with stripped binaries.\"\n \t$(STRIP) $(STRIP_OPTS) $^\n \n ### Flags affecting all rules\n\nbase-commit: cd3e606211bb1cf8bc57f7d76bab98cc17a150bc\n-- \nAn old man doll... just what I always wanted! - Clara\n\n"},{"id":"442148","messageId":"211123.86a6hvuikj.gmgdl@evledraar.gmail.com","threadId":"56965","inReplyTo":"20211123122934.639428-1-bagasdotme@gmail.com","subject":"Re: [RFC PATCH] Makefile: add deprecation message for strip target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-11-23T13:00:43Z","receivedAt":"2021-11-23T13:07:13Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Nov 23 2021, Bagas Sanjaya wrote:\n\n> Now that $INSTALL_STRIP variable can be defined since 3231f41009 (make:\n> add INSTALL_STRIP option variable, 2021-09-05), deprecate 'strip' target\n> to encourage users to move to $INSTALL_STRIP. The target will eventually\n> be removed in Git 2.35+1.\n>\n> Only deprecation message is printed.\n>\n> Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>\n> ---\n>  Makefile | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/Makefile b/Makefile\n> index 12be39ac49..ee83860f7d 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2159,6 +2159,8 @@ please_set_SHELL_PATH_to_a_more_modern_shell:\n>  shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell\n>  \n>  strip: $(PROGRAMS) git$X\n> +\t@echo \"The 'strip' target is deprecated, define INSTALL_STRIP if you want to\"\n> +\t@echo \"install Git with stripped binaries.\"\n>  \t$(STRIP) $(STRIP_OPTS) $^\n>  \n>  ### Flags affecting all rules\n>\n> base-commit: cd3e606211bb1cf8bc57f7d76bab98cc17a150bc\n\nThis is a better way to do this:\n\ndiff --git a/Makefile b/Makefile\nindex 12be39ac497..fd4736dff2f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2159,6 +2159,8 @@ please_set_SHELL_PATH_to_a_more_modern_shell:\n shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell\n \n strip: $(PROGRAMS) git$X\n+       $(warning The 'strip' target is deprecated, define INSTALL_STRIP if you want to \\\n+install stripped binaries)\n        $(STRIP) $(STRIP_OPTS) $^\n \n ### Flags affecting all rules\n\nI.e. GNU make has a built-in way to do this which emits the line number.\n\nThe message also needs to be reworded, now it's telling me \"do xyz to\n...\" do what I just did successfully? It should say something like\n\n    you just did X, but doing that via Y will soon be deprecated, do Z instead\n    to accomplish X\"\n\nSee also:\n\n    git log -p -G'\\$\\((warning|error)' -- Makefile\n\nFor some recent-ish ways of doing phase-in deprecation.\n\nPersonally I think just starting with $(error) would be fine here. If\nsomeone needs to adjust their build system anyway they can just adjust\nit the first time around, it's not like a missing feature in git itself\nwhere the carpet is rudely swept from under you. You'll still be able to\nbuild, you just need to tweak your recipe.\n\nThe real value of $(warning) (or the same with @echo) is IMO something\nlike 6cdccfce1e0 (i18n: make GETTEXT_POISON a runtime option,\n2018-11-08), i.e. to give someone a hint that something works\ndifferently now (although I'd probably just make that $(error) if I was\ndoing it now, with the same rationale).\n"}]}