{"thread":{"id":"60451","subject":"[bug] 2.39.0: error in help for ls-remote","startedAt":"2023-10-31T18:11:59Z","lastAt":"2023-10-31T23:07:25Z","messageCount":3,"participants":["Jeremy Hetzler","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"484240","messageId":"CAOh4nmm9fTm8fa=1Hyi8t3R-VMnf30-0xe0vcst57dvY-FrL+w@mail.gmail.com","threadId":"60451","inReplyTo":"CAOh4nmk2KZBTuW9qn_ZgDY3yLRZ6NgGOWuBMLRRm1sU=pdmRoQ@mail.gmail.com","subject":"[bug] 2.39.0: error in help for ls-remote","fromName":"Jeremy Hetzler","fromEmail":"jeremyhetzler@gmail.com","sentAt":"2023-10-31T18:11:23Z","receivedAt":"2023-10-31T18:11:59Z","isPatch":false,"sender":{"key":"jeremyhetzler@gmail.com","avatar":null},"body":"All,\n\nThe short help for ls-remote advertises that '-h' is short for '--heads':\n\n> usage: git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n>                      [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n>                      [--symref] [<repository> [<refs>...]]\n>\n>\n>     -q, --quiet           do not print remote URL\n>     --upload-pack <exec>  path of git-upload-pack on the remote host\n>     -t, --tags            limit to tags\n>     -h, --heads           limit to heads\n>     --refs                do not show peeled tags\n>     --get-url             take url.<base>.insteadOf into account\n>     --sort <key>          field name to sort on\n>     --exit-code           exit with exit code 2 if no matching refs are found\n>     --symref              show underlying ref in addition to the object pointed by it\n>     -o, --server-option <server-specific>\n>                           option to transmit\n\nHowever, 'git ls-remote -h' instead prints the help. So perhaps the\nhelp message should be revised.\n\ngit version 2.39.0\n\nThanks,\nJeremy\n"},{"id":"484247","messageId":"20231031190959.GA875658@coredump.intra.peff.net","threadId":"60451","inReplyTo":"CAOh4nmm9fTm8fa=1Hyi8t3R-VMnf30-0xe0vcst57dvY-FrL+w@mail.gmail.com","subject":"Re: [bug] 2.39.0: error in help for ls-remote","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-10-31T19:09:59Z","receivedAt":"2023-10-31T19:10:03Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 31, 2023 at 02:11:23PM -0400, Jeremy Hetzler wrote:\n\n> The short help for ls-remote advertises that '-h' is short for '--heads':\n> [...]\n> However, 'git ls-remote -h' instead prints the help. So perhaps the\n> help message should be revised.\n\nIt does work as documented with an argument, like:\n\n  git ls-remote -h <remote>\n\nYes, this is somewhat weird, but is a balance between consistency and\nbackwards compatibility. See:\n\n  https://lore.kernel.org/git/YU4QxcORBBR01iV8@coredump.intra.peff.net/\n\nas a starting point for past discussions.\n\nThe manpage (or \"--help\") describes the behavior correctly; it may be\nthat the \"-h\" output could do so as well, but it's sometimes hard to\ncommunicate such subtleties in such a terse format. So there may be room\nfor a patch to make things more clear there, but I think it may be\ndifficult to do well.\n\n-Peff\n"},{"id":"484266","messageId":"CAOh4nmmxjS177FhdvaEfqkomxe3Q51AbDQrn0RGz+7GXiqaMFA@mail.gmail.com","threadId":"60451","inReplyTo":"20231031190959.GA875658@coredump.intra.peff.net","subject":"Re: [bug] 2.39.0: error in help for ls-remote","fromName":"Jeremy Hetzler","fromEmail":"jeremyhetzler@gmail.com","sentAt":"2023-10-31T23:06:53Z","receivedAt":"2023-10-31T23:07:25Z","isPatch":false,"sender":{"key":"jeremyhetzler@gmail.com","avatar":null},"body":"On Tue, Oct 31, 2023 at 3:10 PM Jeff King <peff@peff.net> wrote:\n>\n> It does work as documented with an argument, like:\n>\n>   git ls-remote -h <remote>\n>\n> Yes, this is somewhat weird, but is a balance between consistency and\n> backwards compatibility. See:\n>\n>   https://lore.kernel.org/git/YU4QxcORBBR01iV8@coredump.intra.peff.net/\n>\n> as a starting point for past discussions.\n>\n> The manpage (or \"--help\") describes the behavior correctly; it may be\n> that the \"-h\" output could do so as well, but it's sometimes hard to\n> communicate such subtleties in such a terse format. So there may be room\n> for a patch to make things more clear there, but I think it may be\n> difficult to do well.\n>\n> -Peff\n\nI see.\n\nI would still find it clearer if there were a fuller explanation in\nthe \"-h\" output, but it's not a big deal. At least I'm not the only\none who's been confused :)\n\nThanks,\nJeremy\n"}]}