{"thread":{"id":"22763","subject":"[PATCH] Wrap RUNTIME_PREFIX warning in a compile-time condition","startedAt":"2010-02-23T08:32:02Z","lastAt":"2010-02-23T12:57:59Z","messageCount":8,"participants":["Johannes Sixt","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"135403","messageId":"4B839282.1020605@viscovery.net","threadId":"22763","inReplyTo":null,"subject":"[PATCH] Wrap RUNTIME_PREFIX warning in a compile-time condition","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-02-23T08:32:02Z","receivedAt":"2010-02-23T08:32:02Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nWhen RUNTIME_PREFIX is enabled, the installation prefix is derived by\ntrying a limited set of known locations where the git executable can\nreside. If none of these is found, a warning is emitted.\n\nWhen git is built in a directory that matches neither of these known names,\nthe warning would always be emitted when the uninstalled executable is run.\nThis is a problem on Windows, where gitk picks the uninstalled git when\ninvoked on the build directory and gets confused by the warning.\n\nWith this patch, individual developers can disable the warning by setting\n\n   BASIC_CFLAGS += -DNO_WARN_RUNTIME_PREFIX\n\nin config.mak.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n exec_cmd.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/exec_cmd.c b/exec_cmd.c\nindex 408e4e5..5a22635 100644\n--- a/exec_cmd.c\n+++ b/exec_cmd.c\n@@ -28,9 +28,11 @@ const char *system_path(const char *path)\n \t    !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&\n \t    !(prefix = strip_path_suffix(argv0_path, \"git\"))) {\n \t\tprefix = PREFIX;\n+#ifndef NO_WARN_RUNTIME_PREFIX\n \t\tfprintf(stderr, \"RUNTIME_PREFIX requested, \"\n \t\t\t\t\"but prefix computation failed.  \"\n \t\t\t\t\"Using static fallback '%s'.\\n\", prefix);\n+#endif\n \t}\n #endif\n\n-- \n1.7.0.84.g6ef09\n"},{"id":"135408","messageId":"alpine.DEB.1.00.1002231041230.20986@pacific.mpi-cbg.de","threadId":"22763","inReplyTo":"4B839282.1020605@viscovery.net","subject":"Re: [PATCH] Wrap RUNTIME_PREFIX warning in a compile-time condition","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2010-02-23T09:42:00Z","receivedAt":"2010-02-23T09:42:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Feb 2010, Johannes Sixt wrote:\n\n> From: Johannes Sixt <j6t@kdbg.org>\n> \n> When RUNTIME_PREFIX is enabled, the installation prefix is derived by\n> trying a limited set of known locations where the git executable can\n> reside. If none of these is found, a warning is emitted.\n> \n> When git is built in a directory that matches neither of these known names,\n> the warning would always be emitted when the uninstalled executable is run.\n> This is a problem on Windows, where gitk picks the uninstalled git when\n> invoked on the build directory and gets confused by the warning.\n> \n> With this patch, individual developers can disable the warning by setting\n> \n>    BASIC_CFLAGS += -DNO_WARN_RUNTIME_PREFIX\n> \n> in config.mak.\n\nWould this option not prefer to be a runtime option? An environment \nvariable should suffice.\n\nCiao,\nDscho\n"},{"id":"135409","messageId":"4B83A330.5080403@viscovery.net","threadId":"22763","inReplyTo":"alpine.DEB.1.00.1002231041230.20986@pacific.mpi-cbg.de","subject":"Re: [PATCH] Wrap RUNTIME_PREFIX warning in a compile-time condition","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-02-23T09:43:12Z","receivedAt":"2010-02-23T09:43:12Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> On Tue, 23 Feb 2010, Johannes Sixt wrote:\n>> With this patch, individual developers can disable the warning by setting\n>>\n>>    BASIC_CFLAGS += -DNO_WARN_RUNTIME_PREFIX\n>>\n>> in config.mak.\n> \n> Would this option not prefer to be a runtime option?\n\nNo. The warning is utterly useless IMO and extremely annoying, and the\nonly reason that it still survives is because you disagree. ;-) Since\nnobody else than I has ever complained about this warning, this patch\nlooks like tailor-made for me and my build-environment (and nobody else\nwill be affected by default), and I don't want to set an environment\nvariable, thank you.\n\n-- Hannes\n"},{"id":"135410","messageId":"alpine.DEB.1.00.1002231103170.20986@pacific.mpi-cbg.de","threadId":"22763","inReplyTo":"4B83A330.5080403@viscovery.net","subject":"Re: [PATCH] Wrap RUNTIME_PREFIX warning in a compile-time condition","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2010-02-23T10:03:39Z","receivedAt":"2010-02-23T10:03:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Feb 2010, Johannes Sixt wrote:\n\n> Johannes Schindelin schrieb:\n> > On Tue, 23 Feb 2010, Johannes Sixt wrote:\n> >> With this patch, individual developers can disable the warning by setting\n> >>\n> >>    BASIC_CFLAGS += -DNO_WARN_RUNTIME_PREFIX\n> >>\n> >> in config.mak.\n> > \n> > Would this option not prefer to be a runtime option?\n> \n> No. The warning is utterly useless IMO and extremely annoying, and the\n> only reason that it still survives is because you disagree. ;-)\n\nI have been convinced of things before. It just takes a good argument.\n\nCiao,\nDscho\n"},{"id":"135411","messageId":"4B83A9A2.5080500@viscovery.net","threadId":"22763","inReplyTo":"alpine.DEB.1.00.1002231103170.20986@pacific.mpi-cbg.de","subject":"Re: [PATCH] Wrap RUNTIME_PREFIX warning in a compile-time condition","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-02-23T10:10:42Z","receivedAt":"2010-02-23T10:10:42Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> On Tue, 23 Feb 2010, Johannes Sixt wrote:\n>> Johannes Schindelin schrieb:\n>>> On Tue, 23 Feb 2010, Johannes Sixt wrote:\n>>>> With this patch, individual developers can disable the warning by setting\n>>>>\n>>>>    BASIC_CFLAGS += -DNO_WARN_RUNTIME_PREFIX\n>>>>\n>>>> in config.mak.\n>>> Would this option not prefer to be a runtime option?\n>> No. The warning is utterly useless IMO and extremely annoying, and the\n>> only reason that it still survives is because you disagree. ;-)\n> \n> I have been convinced of things before. It just takes a good argument.\n\nThe good argument is:\n\nWith this patch in upstream git, I have more time to spend on testing\ntopics from pu and to write new topics on top of vanilla master because I\ndon't need to apply my private patch all over the place (and back it out\nbefore I submit patches).\n\nWhether the option is compile-time or runtime is secondary. The option is\n*for me*,[*] and I prefer it compile-time. *For you* nothing changes\nregardless of compile-time or runtime (or do you think you would set the\noption?).\n\n[*] As I said, nobody else seems to complain.\n\n-- Hannes\n"},{"id":"135413","messageId":"alpine.DEB.1.00.1002231201260.3980@intel-tinevez-2-302","threadId":"22763","inReplyTo":"4B83A9A2.5080500@viscovery.net","subject":"Re: [PATCH] Wrap RUNTIME_PREFIX warning in a compile-time condition","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2010-02-23T11:07:38Z","receivedAt":"2010-02-23T11:07:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Feb 2010, Johannes Sixt wrote:\n\n> [*] As I said, nobody else seems to complain.\n\nIf it is so annoying (and I agree that it hit me, too), maybe just remove \nit altogether. It is not really a helpful warning, either.\n\nMaybe the best would be to replace it with a trace_printf().\n\nCiao,\nDscho\n\nP.S.: I cannot recall defending the warning, but I might have thought it a \ngood idea at some stage. This is no longer so.\n"},{"id":"135415","messageId":"4B83BF40.4070802@viscovery.net","threadId":"22763","inReplyTo":"alpine.DEB.1.00.1002231201260.3980@intel-tinevez-2-302","subject":"[PATCH] Print RUNTIME_PREFIX warning only when GIT_TRACE is set","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-02-23T11:42:56Z","receivedAt":"2010-02-23T11:42:56Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nWhen RUNTIME_PREFIX is enabled, the installation prefix is derived by\ntrying a limited set of known locations where the git executable can\nreside. If none of these is found, a warning is emitted.\n\nWhen git is built in a directory that matches neither of these known names,\nthe warning would always be emitted when the uninstalled executable is run.\nThis is a problem on Windows, where gitk picks the uninstalled git when\ninvoked from the build directory and gets confused by the warning.\n\nPrint the warning only when GIT_TRACE is set.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\nJohannes Schindelin schrieb:\n> P.S.: I cannot recall defending the warning, but I might have thought it a \n> good idea at some stage. This is no longer so.\n\nI do recall you defended it; good to know that you changed your mind.\n\nThanks,\n-- Hannes\n\n exec_cmd.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/exec_cmd.c b/exec_cmd.c\nindex 408e4e5..b2c07c7 100644\n--- a/exec_cmd.c\n+++ b/exec_cmd.c\n@@ -28,7 +28,7 @@ const char *system_path(const char *path)\n \t    !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&\n \t    !(prefix = strip_path_suffix(argv0_path, \"git\"))) {\n \t\tprefix = PREFIX;\n-\t\tfprintf(stderr, \"RUNTIME_PREFIX requested, \"\n+\t\ttrace_printf(\"RUNTIME_PREFIX requested, \"\n \t\t\t\t\"but prefix computation failed.  \"\n \t\t\t\t\"Using static fallback '%s'.\\n\", prefix);\n \t}\n-- \n1.7.0.83.g241b9.dirty\n"},{"id":"135421","messageId":"alpine.DEB.1.00.1002231357460.3980@intel-tinevez-2-302","threadId":"22763","inReplyTo":"4B83BF40.4070802@viscovery.net","subject":"Re: [PATCH] Print RUNTIME_PREFIX warning only when GIT_TRACE is set","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2010-02-23T12:57:59Z","receivedAt":"2010-02-23T12:57:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Feb 2010, Johannes Sixt wrote:\n\n> From: Johannes Sixt <j6t@kdbg.org>\n> \n> When RUNTIME_PREFIX is enabled, the installation prefix is derived by\n> trying a limited set of known locations where the git executable can\n> reside. If none of these is found, a warning is emitted.\n> \n> When git is built in a directory that matches neither of these known names,\n> the warning would always be emitted when the uninstalled executable is run.\n> This is a problem on Windows, where gitk picks the uninstalled git when\n> invoked from the build directory and gets confused by the warning.\n> \n> Print the warning only when GIT_TRACE is set.\n> \n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n\nACK\n\nAnd thanks,\nDscho\n"}]}