{"thread":{"id":"11250","subject":"[PATCH 2/2] git-help: add \"web_or_man\" and \"web_or_info\" config vars.","startedAt":"2007-12-12T05:33:25Z","lastAt":"2007-12-12T11:22:09Z","messageCount":4,"participants":["Christian Couder","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"62857","messageId":"20071212063325.92cd29a8.chriscool@tuxfamily.org","threadId":"11250","inReplyTo":null,"subject":"[PATCH 2/2] git-help: add \"web_or_man\" and \"web_or_info\" config vars.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-12-12T05:33:25Z","receivedAt":"2007-12-12T05:33:25Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"These configuration variables can be used when you want to\nuse a web browser if DISPLAY is set and \"man\" or \"info\"\notherwise.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/git-help.txt |   15 +++++++++++----\n help.c                     |   10 ++++++++++\n 2 files changed, 21 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-help.txt b/Documentation/git-help.txt\nindex af5e5cb..c790584 100644\n--- a/Documentation/git-help.txt\n+++ b/Documentation/git-help.txt\n@@ -24,10 +24,17 @@ up. The 'man' program is used by default for this purpose, but this\n can be overriden by other options.\n \n If no command line option is passed, the 'help.format' configuration\n-variable will be checked. Supported values for this variable are\n-\"man\", \"info\" and \"web\" (or \"html\" as a synonym to the latter). This\n-makes git-help behave as if a command line option with the same long\n-name as been passed to it.\n+variable will be checked. The following values are supported for this\n+variable; they make 'git-help' behave as their corresponding command\n+line option:\n+\n+* \"man\" corresponds to '-m|--man',\n+* \"info\" corresponds to '-i|--info',\n+* \"web\" or \"html\" correspond to '-w|--web',\n+* \"web_or_man\" corresponds to '-w|--web' if DISPLAY is set, '-m|--man'\n+otherwise,\n+* \"web_or_info\" corresponds to '-w|--web' if DISPLAY is set, '-i|--info'\n+otherwise.\n \n Note that 'git --help ...' is identical as 'git help ...' because the\n former is internally converted into the latter.\ndiff --git a/help.c b/help.c\nindex af0a433..d46bc08 100644\n--- a/help.c\n+++ b/help.c\n@@ -34,6 +34,16 @@ static void parse_help_format(const char *format)\n \t\thelp_format = web_format;\n \t\treturn;\n \t}\n+\tif (!strcmp(format, \"web_or_man\")) {\n+\t\tchar *display = getenv(\"DISPLAY\");\n+\t\thelp_format = display ? web_format : man_format;\n+\t\treturn;\n+\t}\n+\tif (!strcmp(format, \"web_or_info\")) {\n+\t\tchar *display = getenv(\"DISPLAY\");\n+\t\thelp_format = display ? web_format : info_format;\n+\t\treturn;\n+\t}\n \tdie(\"unrecognized help format '%s'\", format);\n }\n \n-- \n1.5.3.7.2269.g4ae7\n"},{"id":"62858","messageId":"7v1w9sbhlg.fsf@gitster.siamese.dyndns.org","threadId":"11250","inReplyTo":"20071212063325.92cd29a8.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] git-help: add \"web_or_man\" and \"web_or_info\" config vars.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-12T05:35:39Z","receivedAt":"2007-12-12T05:35:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I personally feel this is going a bit overboard.  We'd be better off\ndoing something like this:\n\n - add 'help.external' configuration variable, that allows the user to\n   set any external program;\n\n - spawn the external program when \"git help <cmd>\" is given, with <cmd>\n   as the parameter;\n\n - add an option to 'git config' to dump various paths configured in the\n   git program, such as manual page path, info page path and such, so\n   that the external program can learn where things are.\n\nThe second point above means that translating \"cat-file\" to\n\"git-cat-file.html\" becomes the responsibility for the external\nprogram.\n"},{"id":"62862","messageId":"200712120817.33308.chriscool@tuxfamily.org","threadId":"11250","inReplyTo":"7v1w9sbhlg.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/2] git-help: add \"web_or_man\" and \"web_or_info\" config vars.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-12-12T07:17:33Z","receivedAt":"2007-12-12T07:17:33Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le mercredi 12 décembre 2007, Junio C Hamano a écrit :\n> I personally feel this is going a bit overboard. \n\nThe main problem without it is for people who like web browser, but often \nuse ssh without -Y. In this latter case, they may enter into \"manly\" mode, \nyou know, and don't want to be bothered to install or use some kind of text \nbased web browser.\n\nChristian.\n"},{"id":"62898","messageId":"Pine.LNX.4.64.0712121121420.27959@racer.site","threadId":"11250","inReplyTo":"20071212063325.92cd29a8.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] git-help: add \"web_or_man\" and \"web_or_info\" config vars.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-12T11:22:09Z","receivedAt":"2007-12-12T11:22:09Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\n\"web_or_man\" is completely out of line with our existing CamelCase config \nvariables.\n\nCiao,\nDscho\n"}]}