{"thread":{"id":"3871","subject":"git log is a bit antisocial","startedAt":"2006-04-14T20:50:07Z","lastAt":"2006-04-14T22:45:14Z","messageCount":8,"participants":["Nicolas Pitre","Junio C Hamano","Sébastien Pierre"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"18651","messageId":"Pine.LNX.4.64.0604141647360.2215@localhost.localdomain","threadId":"3871","inReplyTo":null,"subject":"git log is a bit antisocial","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-04-14T20:50:07Z","receivedAt":"2006-04-14T20:50:07Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"\n$  git log -h\nfatal: unrecognized argument: -h\n$ git log --help\nfatal: unrecognized argument: --help\n\nMaybe the usage string could be printed in those cases?\n\n\nNicolas\n"},{"id":"18652","messageId":"7vlku7q3k7.fsf@assigned-by-dhcp.cox.net","threadId":"3871","inReplyTo":"Pine.LNX.4.64.0604141647360.2215@localhost.localdomain","subject":"Re: git log is a bit antisocial","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-14T20:56:24Z","receivedAt":"2006-04-14T20:56:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Pitre <nico@cam.org> writes:\n\n> $  git log -h\n> fatal: unrecognized argument: -h\n> $ git log --help\n> fatal: unrecognized argument: --help\n>\n> Maybe the usage string could be printed in those cases?\n\nPerhaps.  Alternatively, \"git help log\", perhaps.\n"},{"id":"18653","messageId":"Pine.LNX.4.64.0604141719290.2215@localhost.localdomain","threadId":"3871","inReplyTo":"7vlku7q3k7.fsf@assigned-by-dhcp.cox.net","subject":"Re: git log is a bit antisocial","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-04-14T21:20:13Z","receivedAt":"2006-04-14T21:20:13Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Fri, 14 Apr 2006, Junio C Hamano wrote:\n\n> Nicolas Pitre <nico@cam.org> writes:\n> \n> > $  git log -h\n> > fatal: unrecognized argument: -h\n> > $ git log --help\n> > fatal: unrecognized argument: --help\n> >\n> > Maybe the usage string could be printed in those cases?\n> \n> Perhaps.  Alternatively, \"git help log\", perhaps.\n\nWhat about git-log then?\n\n\nNicolas\n"},{"id":"18654","messageId":"7vhd4vq23h.fsf@assigned-by-dhcp.cox.net","threadId":"3871","inReplyTo":"Pine.LNX.4.64.0604141719290.2215@localhost.localdomain","subject":"Re: git log is a bit antisocial","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-14T21:28:02Z","receivedAt":"2006-04-14T21:28:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Pitre <nico@cam.org> writes:\n\n> On Fri, 14 Apr 2006, Junio C Hamano wrote:\n>\n>> Nicolas Pitre <nico@cam.org> writes:\n>> \n>> > $  git log -h\n>> > fatal: unrecognized argument: -h\n>> > $ git log --help\n>> > fatal: unrecognized argument: --help\n>> >\n>> > Maybe the usage string could be printed in those cases?\n>> \n>> Perhaps.  Alternatively, \"git help log\", perhaps.\n>\n> What about git-log then?\n\nWhat about it?\n\nAsking for help on log could be spelled as \"git log --help\" with\na patch like the attached, but I am not sure that is worth it...\n\n-- >8 --\ndiff --git a/git.c b/git.c\nindex 78ed403..7fdacdd 100644\n--- a/git.c\n+++ b/git.c\n@@ -497,6 +497,16 @@ int main(int argc, const char **argv, ch\n \t}\n \targv[0] = cmd;\n \n+\t/* It could be git blah --help or git boo -h, but be\n+\t * careful; most commands have their own '-h' and '--help'.\n+\t */\n+\tif (argc == 2 &&\n+\t    (!strcmp(argv[1], \"-h\") || !strcmp(argv[1], \"--help\"))) {\n+\t\targv[0] = \"help\";\n+\t\targv[1] = cmd;\n+\t\texit(cmd_help(1, argv, envp));\n+\t}\n+\n \t/*\n \t * We search for git commands in the following order:\n \t *  - git_exec_path()\n"},{"id":"18655","messageId":"1145051072.27704.1.camel@localhost.localdomain","threadId":"3871","inReplyTo":"7vhd4vq23h.fsf@assigned-by-dhcp.cox.net","subject":"Re: git log is a bit antisocial","fromName":"Sébastien Pierre","fromEmail":"sebastien@xprima.com","sentAt":"2006-04-14T21:44:32Z","receivedAt":"2006-04-14T21:44:32Z","isPatch":false,"sender":{"key":"sebastien@xprima.com","avatar":null},"body":"Le vendredi 14 avril 2006 à 14:28 -0700, Junio C Hamano a écrit :\n\n> What about it?\n> \n> Asking for help on log could be spelled as \"git log --help\" with\n> a patch like the attached, but I am not sure that is worth it...\n\nI would say that it is very useful to newbies, or simply not to\nfrustrate users trying to get help. It is really worth it, at least for\nme.\n\n -- Sébastien\n"},{"id":"18656","messageId":"7vu08volrp.fsf@assigned-by-dhcp.cox.net","threadId":"3871","inReplyTo":"1145051072.27704.1.camel@localhost.localdomain","subject":"Re: git log is a bit antisocial","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-14T22:06:02Z","receivedAt":"2006-04-14T22:06:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sébastien Pierre <sebastien@xprima.com> writes:\n\n> Le vendredi 14 avril 2006 à 14:28 -0700, Junio C Hamano a écrit :\n>\n>> What about it?\n>> \n>> Asking for help on log could be spelled as \"git log --help\" with\n>> a patch like the attached, but I am not sure that is worth it...\n>\n> I would say that it is very useful to newbies, or simply not to\n> frustrate users trying to get help. It is really worth it, at least for\n> me.\n\nHave you read the patch, especially the comment in it?  With and\nwithout the patch, this command would behave quite differently:\n\n\t$ git commit --help\n"},{"id":"18657","messageId":"1145052905.27704.8.camel@localhost.localdomain","threadId":"3871","inReplyTo":"7vu08volrp.fsf@assigned-by-dhcp.cox.net","subject":"Re: git log is a bit antisocial","fromName":"Sébastien Pierre","fromEmail":"sebastien@xprima.com","sentAt":"2006-04-14T22:15:05Z","receivedAt":"2006-04-14T22:15:05Z","isPatch":false,"sender":{"key":"sebastien@xprima.com","avatar":null},"body":"Le vendredi 14 avril 2006 à 15:06 -0700, Junio C Hamano a écrit :\n\n> Have you read the patch, especially the comment in it?  With and\n> without the patch, this command would behave quite differently:\n\nI did not realize that at first (I thought this would be a fallback\nmethod). \n\nAnyway, on git 1.2.3, here is something interesting:\n\n>> git log -h\nfatal: Not a git repository\n\n>> git log --help\nUsage: /home/sebastien/Local/bin/git-log [--max-count=<n>]\n[<since>..<limit>] [--pretty=<format>] [git-rev-list options]\n\nWhich is confusing, so having a consistent behaviour for \"git help cmd\",\n\"git cmd help\", \"git cmd -h\" and \"git cmd --help\" would be nice.\n\nFor instance, Darcs works just like that, which makes it easy for\nnewbies to find there ways through.\n\n -- Sébastien\n"},{"id":"18659","messageId":"7vd5fjojyd.fsf@assigned-by-dhcp.cox.net","threadId":"3871","inReplyTo":"1145052905.27704.8.camel@localhost.localdomain","subject":"Re: git log is a bit antisocial","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-14T22:45:14Z","receivedAt":"2006-04-14T22:45:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sébastien Pierre <sebastien@xprima.com> writes:\n\n> Anyway, on git 1.2.3, here is something interesting:\n>\n>>> git log -h\n> fatal: Not a git repository\n>\n>>> git log --help\n> Usage: /home/sebastien/Local/bin/git-log [--max-count=<n>]\n> [<since>..<limit>] [--pretty=<format>] [git-rev-list options]\n\nYou are talking about old codebase in the maitenance branch,\nwhich is an independent issue, but thanks for noticing anyway.\n\nThe attached patch would help with that.\n\n> Which is confusing, so having a consistent behaviour for \"git help cmd\",\n> \"git cmd help\", \"git cmd -h\" and \"git cmd --help\" would be nice.\n>\n> For instance, Darcs works just like that, which makes it easy for\n> newbies to find there ways through.\n\nPatches welcome, but a new development should be based on the\n\"master\" branch, not the maintenance 1.2.X series.\n\n-- >8 --\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex 025ef2d..d15747f 100755\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -30,7 +30,7 @@ else\n fi\n \n case \"$1\" in\n-\t--h|--he|--hel|--help)\n+\t-h|--h|--he|--hel|--help)\n \techo \"$LONG_USAGE\"\n \texit\n esac\n"}]}