{"thread":{"id":"48563","subject":"why do \"git log -h\" and \"git show -h\" print the same thing?","startedAt":"2018-05-24T13:39:47Z","lastAt":"2018-05-27T10:24:31Z","messageCount":4,"participants":["Robert P. J. Day","Stefan Beller","Thomas Gummerer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"348428","messageId":"alpine.LFD.2.21.1805240934010.12018@localhost.localdomain","threadId":"48563","inReplyTo":null,"subject":"why do \"git log -h\" and \"git show -h\" print the same thing?","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2018-05-24T13:37:48Z","receivedAt":"2018-05-24T13:39:47Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"\n  maybe this is deliberate, but it's confusing that, with git 2.17.0,\nthe output of both \"git log -h\" and \"git show -h\" is exactly the same:\n\n$ git log -h\nusage: git log [<options>] [<revision-range>] [[--] <path>...]\n   or: git show [<options>] <object>...\n\n    -q, --quiet           suppress diff output\n    --source              show source\n    --use-mailmap         Use mail map file\n    --decorate-refs <pattern>\n                          only decorate refs that match <pattern>\n    --decorate-refs-exclude <pattern>\n                          do not decorate refs that match <pattern>\n    --decorate[=...]      decorate options\n    -L <n,m:file>         Process line range n,m in file, counting from 1\n$\n\nis that what's *supposed* to happen?\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                  http://crashcourse.ca/dokuwiki\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"},{"id":"348494","messageId":"CAGZ79kY8CjLsTqY2YXJ8hPA41XrbYZrtK7yO59vrbA5M_vorVg@mail.gmail.com","threadId":"48563","inReplyTo":"alpine.LFD.2.21.1805240934010.12018@localhost.localdomain","subject":"Re: why do \"git log -h\" and \"git show -h\" print the same thing?","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-24T22:42:58Z","receivedAt":"2018-05-24T22:43:03Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Thu, May 24, 2018 at 6:37 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n>\n>   maybe this is deliberate, but it's confusing that, with git 2.17.0,\n> the output of both \"git log -h\" and \"git show -h\" is exactly the same:\n>\n> $ git log -h\n> usage: git log [<options>] [<revision-range>] [[--] <path>...]\n>    or: git show [<options>] <object>...\n>\n>     -q, --quiet           suppress diff output\n>     --source              show source\n>     --use-mailmap         Use mail map file\n>     --decorate-refs <pattern>\n>                           only decorate refs that match <pattern>\n>     --decorate-refs-exclude <pattern>\n>                           do not decorate refs that match <pattern>\n>     --decorate[=...]      decorate options\n>     -L <n,m:file>         Process line range n,m in file, counting from 1\n> $\n>\n> is that what's *supposed* to happen?\n\nI would think so, show is just \"log -p\" with the range clamped\ndown to <object>^..<object>.\n\nIt's been in the code like that for a couple years by now,\ne.g. see\ne66dc0cc4b1a6 log.c: fix translation markings, 2015-01-06\n"},{"id":"348497","messageId":"alpine.LFD.2.21.1805241852370.11801@localhost.localdomain","threadId":"48563","inReplyTo":"CAGZ79kY8CjLsTqY2YXJ8hPA41XrbYZrtK7yO59vrbA5M_vorVg@mail.gmail.com","subject":"Re: why do \"git log -h\" and \"git show -h\" print the same thing?","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2018-05-24T22:53:09Z","receivedAt":"2018-05-24T22:54:56Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"On Thu, 24 May 2018, Stefan Beller wrote:\n\n> On Thu, May 24, 2018 at 6:37 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n> >\n> >   maybe this is deliberate, but it's confusing that, with git 2.17.0,\n> > the output of both \"git log -h\" and \"git show -h\" is exactly the same:\n> >\n> > $ git log -h\n> > usage: git log [<options>] [<revision-range>] [[--] <path>...]\n> >    or: git show [<options>] <object>...\n> >\n> >     -q, --quiet           suppress diff output\n> >     --source              show source\n> >     --use-mailmap         Use mail map file\n> >     --decorate-refs <pattern>\n> >                           only decorate refs that match <pattern>\n> >     --decorate-refs-exclude <pattern>\n> >                           do not decorate refs that match <pattern>\n> >     --decorate[=...]      decorate options\n> >     -L <n,m:file>         Process line range n,m in file, counting from 1\n> > $\n> >\n> > is that what's *supposed* to happen?\n>\n> I would think so, show is just \"log -p\" with the range clamped\n> down to <object>^..<object>.\n>\n> It's been in the code like that for a couple years by now,\n> e.g. see\n> e66dc0cc4b1a6 log.c: fix translation markings, 2015-01-06\n\n  ah, very well, it just caught me by surprise.\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                  http://crashcourse.ca/dokuwiki\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"},{"id":"348625","messageId":"20180527102452.GA8868@hank.intra.tgummerer.com","threadId":"48563","inReplyTo":"CAGZ79kY8CjLsTqY2YXJ8hPA41XrbYZrtK7yO59vrbA5M_vorVg@mail.gmail.com","subject":"Re: why do \"git log -h\" and \"git show -h\" print the same thing?","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2018-05-27T10:24:52Z","receivedAt":"2018-05-27T10:24:31Z","isPatch":false,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"On 05/24, Stefan Beller wrote:\n> On Thu, May 24, 2018 at 6:37 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n> >\n> >   maybe this is deliberate, but it's confusing that, with git 2.17.0,\n> > the output of both \"git log -h\" and \"git show -h\" is exactly the same:\n> >\n> > $ git log -h\n> > usage: git log [<options>] [<revision-range>] [[--] <path>...]\n> >    or: git show [<options>] <object>...\n> >\n> >     -q, --quiet           suppress diff output\n> >     --source              show source\n> >     --use-mailmap         Use mail map file\n> >     --decorate-refs <pattern>\n> >                           only decorate refs that match <pattern>\n> >     --decorate-refs-exclude <pattern>\n> >                           do not decorate refs that match <pattern>\n> >     --decorate[=...]      decorate options\n> >     -L <n,m:file>         Process line range n,m in file, counting from 1\n> > $\n> >\n> > is that what's *supposed* to happen?\n> \n> I would think so, show is just \"log -p\" with the range clamped\n> down to <object>^..<object>.\n\nHmm, that's not true though if the object is not a commit, from my\nunderstanding?  While 'git show' does share some of its code with 'git\nlog', what you get as output may be quite different from what you'd\nget with 'git log'.  So I feel like we're leaking an implementation\ndetail to the user here, and I can see how it is confusing especially\nfor new users.\n\nSo I do feel like there's some room for improvement here, by only\nshowing the help for the command that was actually used.  I would\nwelcome a patch to that extend, but obviously I'm not the authority\nhere :)\n\n> It's been in the code like that for a couple years by now,\n> e.g. see\n> e66dc0cc4b1a6 log.c: fix translation markings, 2015-01-06\n"}]}