Re: [PATCH 1/1] ls-remote: don't use '-h' for options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-02-27 14:08, Danh Doan wrote:
On 2020-02-27 12:42:18+0100, dev@xxxxxxxxxxxxxxxxx wrote:
The '-h' option for ls-remote will never be reached as the argument is
already processed by the git wrapper before passed on to ls-remote.
The ls-remote help text will therefore be displayed instead of the
'--heads' option.

No, git ls-remote still see '-h'

- 'git ls-remote -h' will show short help.
- 'git ls-remote -h <remote>' and 'git ls-remote --heads <remote>'
  will show the same output

See also:
https://lore.kernel.org/git/xmqqk1ztmkbn.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx/

xmqqk1ztmkbn.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx

You are right, I didn't test with <remote>. Thanks for pointing me to the old discussion.

Because '--heads' can be used without a remote, and '-h' is advertised as the shorthand equivalent, they should produce exactly the same output. And they don't. The discussion aside if you should use '-h' for anything at all except showing help, in my opinion if an option is listed as an alias for another option, they should produce the same result for all (or in this case the lack of) parameters.

In my case I looked into the documentation, used '-h' exactly as described ('<refs>' is optional) and it didn't produce the output as described. If you ask me, either the code or the documentation should be changed.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux