git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Danh Doan <congdanhqx@gmail.com>
To: dev@pascalroeleven.nl
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/1] ls-remote: don't use '-h' for options
Date: Thu, 27 Feb 2020 20:08:33 +0700	[thread overview]
Message-ID: <20200227130833.GA10339@danh.dev> (raw)
In-Reply-To: <b0397b3285eab3448a3fd5dd2c50abb9@pascalroeleven.nl>

On 2020-02-27 12:42:18+0100, dev@pascalroeleven.nl 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@gitster.mtv.corp.google.com/

xmqqk1ztmkbn.fsf@gitster.mtv.corp.google.com

> 
> Signed-off-by: Pascal Roeleven <dev@pascalroeleven.nl>
> ---
>  Documentation/git-ls-remote.txt | 1 -
>  builtin/ls-remote.c             | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/Documentation/git-ls-remote.txt
> b/Documentation/git-ls-remote.txt
> index a2ea1fd..b5b7d7a 100644
> --- a/Documentation/git-ls-remote.txt
> +++ b/Documentation/git-ls-remote.txt
> @@ -21,7 +21,6 @@ commit IDs.
> 
>  OPTIONS
>  -------
> --h::
>  --heads::
>  -t::
>  --tags::
> diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
> index 6ef5195..85ce336 100644
> --- a/builtin/ls-remote.c
> +++ b/builtin/ls-remote.c
> @@ -63,7 +63,7 @@ int cmd_ls_remote(int argc, const char **argv, const char
> *prefix)
>  			   N_("path of git-upload-pack on the remote host"),
>  			   PARSE_OPT_HIDDEN },
>  		OPT_BIT('t', "tags", &flags, N_("limit to tags"), REF_TAGS),
> -		OPT_BIT('h', "heads", &flags, N_("limit to heads"), REF_HEADS),
> +		OPT_BIT(0, "heads", &flags, N_("limit to heads"), REF_HEADS),
>  		OPT_BIT(0, "refs", &flags, N_("do not show peeled tags"), REF_NORMAL),
>  		OPT_BOOL(0, "get-url", &get_url,
>  			 N_("take url.<base>.insteadOf into account")),
> -- 
> 2.20.1
> 

-- 
Danh

  reply	other threads:[~2020-02-27 13:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 11:42 [PATCH 1/1] ls-remote: don't use '-h' for options dev
2020-02-27 13:08 ` Danh Doan [this message]
2020-02-27 14:10   ` Pascal Roeleven
2020-02-27 16:10     ` Junio C Hamano
2020-02-27 17:39       ` Pascal Roeleven
2020-02-27 17:54         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200227130833.GA10339@danh.dev \
    --to=congdanhqx@gmail.com \
    --cc=dev@pascalroeleven.nl \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).