{"thread":{"id":"3393","subject":"Re: [PATCH] git-rev-list --help anywhere","startedAt":"2006-02-19T11:26:27Z","lastAt":"2006-02-20T05:52:07Z","messageCount":6,"participants":["linux@horizon.com","Alex Riesen","Johannes Schindelin","A Large Angry SCM","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"16403","messageId":"20060219112627.18989.qmail@science.horizon.com","threadId":"3393","inReplyTo":null,"subject":"Re: [PATCH] git-rev-list --help anywhere","fromName":"","fromEmail":"linux@horizon.com","sentAt":"2006-02-19T11:26:27Z","receivedAt":"2006-02-19T11:26:27Z","isPatch":true,"sender":{"key":"linux@horizon.com","avatar":null},"body":">+\tfor (i = 1 ; i < argc; i++)\n>+\t    if ( !strcmp(argv[i], \"--help\") )\n>+\t\tusage(rev_list_usage);\n\nYou might want to try something more like:\n\n+\tfor (i = 1 ; i < argc; i++) {\n+\t    if ( !strcmp(argv[i], \"--help\") )\n+\t\tusage(rev_list_usage);\n+\t    if ( !strcmp(argv[i], \"--\") )\n+\t\tbreak;\n+\t}\n\nSo that you don't break in the perverse but legal case of\nhaving a file named \"--help\".\n"},{"id":"16415","messageId":"20060219183930.GB10010@steel.home","threadId":"3393","inReplyTo":"20060219112627.18989.qmail@science.horizon.com","subject":"Re: [PATCH] git-rev-list --help anywhere","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-02-19T18:39:30Z","receivedAt":"2006-02-19T18:39:30Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"linux@horizon.com, Sun, Feb 19, 2006 12:26:27 +0100:\n> >+\tfor (i = 1 ; i < argc; i++)\n> >+\t    if ( !strcmp(argv[i], \"--help\") )\n> >+\t\tusage(rev_list_usage);\n> \n> You might want to try something more like:\n> \n> +\tfor (i = 1 ; i < argc; i++) {\n> +\t    if ( !strcmp(argv[i], \"--help\") )\n> +\t\tusage(rev_list_usage);\n> +\t    if ( !strcmp(argv[i], \"--\") )\n> +\t\tbreak;\n> +\t}\n> \n> So that you don't break in the perverse but legal case of\n> having a file named \"--help\".\n\nOf course. Thanks!\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n\n---\n\ndiff --git a/rev-list.c b/rev-list.c\nindex f2d1105..bcb492e 100644\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -755,11 +755,20 @@ static void handle_all(struct commit_lis\n \n int main(int argc, const char **argv)\n {\n-\tconst char *prefix = setup_git_directory();\n+\tconst char *prefix;\n \tstruct commit_list *list = NULL;\n \tint i, limited = 0;\n \n \tfor (i = 1 ; i < argc; i++) {\n+\t    if ( !strcmp(argv[i], \"--help\") )\n+\t\tusage(rev_list_usage);\n+\t    if ( !strcmp(argv[i], \"--\") )\n+\t\tbreak;\n+\t}\n+\n+\tprefix = setup_git_directory();\n+\n+\tfor (i = 1 ; i < argc; i++) {\n \t\tint flags;\n \t\tconst char *arg = argv[i];\n \t\tchar *dotdot;\n--\n1.2.2.gbc57\n"},{"id":"16416","messageId":"Pine.LNX.4.63.0602192023270.11855@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"3393","inReplyTo":"20060219183930.GB10010@steel.home","subject":"Re: [PATCH] git-rev-list --help anywhere","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-02-19T19:25:02Z","receivedAt":"2006-02-19T19:25:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\ncan someone please enlighten me why you need to see the usage, when you \ncannot execute the command anyway?\n\nPuzzled,\nDscho\n"},{"id":"16418","messageId":"20060219193940.7493.qmail@science.horizon.com","threadId":"3393","inReplyTo":"Pine.LNX.4.63.0602192023270.11855@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] git-rev-list --help anywhere","fromName":"","fromEmail":"linux@horizon.com","sentAt":"2006-02-19T19:39:40Z","receivedAt":"2006-02-19T19:39:40Z","isPatch":true,"sender":{"key":"linux@horizon.com","avatar":null},"body":"> can someone please enlighten me why you need to see the usage, when you \n> cannot execute the command anyway?\n\nBecause you're writing a script, or explaining it to someone over\nthe phone, or writing shell autocompletion macros, otherwise using\nit in some kind of delayed or deferred way.\n\nThese ain't no steenkin GUI tools; they can be used in more ways\nthat typed interactively for immediate execution.\n\n(Have you ever noticed how all the GUI people have rediscovered the\nconcept of a pathname and a single-character directory separator when\nexplaining how to navigate a menu/dialog maze?  The character '>' seems\nto be popular.\n\tGo to menu A\n\tThen go to submenu B\n\tThen select item C to open a dialog\n\tThen go to tab D of that dialog.\n\tThen hit the \"Advanced options\" button\n\tThen select tab E of that dialog\n\tThen select option F\nHow exactly is this is an improvement over A/B/C/D/Advanced options/E/F?)\n"},{"id":"16419","messageId":"43F8C99E.7080703@gmail.com","threadId":"3393","inReplyTo":"Pine.LNX.4.63.0602192023270.11855@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] git-rev-list --help anywhere","fromName":"A Large Angry SCM","fromEmail":"gitzilla@gmail.com","sentAt":"2006-02-19T19:40:14Z","receivedAt":"2006-02-19T19:40:14Z","isPatch":true,"sender":{"key":"gitzilla@gmail.com","avatar":"https://gravatar.com/avatar/354625c442439908ff3dd99757dee330e29e9df7847472384faf7a00add247fb?d=mp&s=160"},"body":"Johannes Schindelin wrote:\n> Hi,\n> \n> can someone please enlighten me why you need to see the usage, when you \n> cannot execute the command anyway?\n> \n> Puzzled,\n> Dscho\n\nHow about so that you can find the options needed to run the command in \nanother window where it will work.\n"},{"id":"16438","messageId":"7vu0auefw8.fsf@assigned-by-dhcp.cox.net","threadId":"3393","inReplyTo":"Pine.LNX.4.63.0602192023270.11855@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] git-rev-list --help anywhere","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-20T05:52:07Z","receivedAt":"2006-02-20T05:52:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> can someone please enlighten me why you need to see the usage, when you \n> cannot execute the command anyway?\n\nI think Pasky gave rev-list just as an example, as I am sure\nthere are other lowlevel core tools, that share this same\nunfriendliness.  Primarily, these tools are meant for scripting,\nand not for end-user interactive use.  For this reason, it is\nnot high on my priority list to add --help to the lowlevel core\ntools, although it would be nicer to have.\n"}]}