All of lore.kernel.org
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Git Mailing List <git@vger.kernel.org>
Cc: "Martin Ågren" <martin.agren@gmail.com>,
	"Thomas Rikl" <trikl@online.de>,
	"Thomas Gummerer" <t.gummerer@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	"Jeff King" <peff@peff.net>
Subject: [Alt. PATCH] ls-remote: deprecate -h as short for --heads
Date: Tue, 17 Oct 2017 17:39:14 +0200	[thread overview]
Message-ID: <774f08bd-3172-0083-1544-e5f68f6798fa@web.de> (raw)
In-Reply-To: <4d110305-0826-6fd1-91a5-c1ebd0b1e80b@web.de>

Stop advertising -h as the short equivalent of --heads, because it's
used for showing a short help text for almost all other git commands.
Since the ba5f28bf79 (ls-remote: use parse-options api) it has only
been working when used together with other parameters anyway.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
That would be step on the way towards more consistent command line
switches, in the same vein as d69155119 (t0012: test "-h" with
builtins).

 Documentation/git-ls-remote.txt | 1 -
 builtin/ls-remote.c             | 4 +++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt
index 5f2628c8f8..898836a111 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 c4be98ab9e..840deedbef 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -56,7 +56,9 @@ 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),
+		{ OPTION_BIT, 'h', NULL, &flags, NULL, N_("limit to heads"),
+			PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 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.14.2

  parent reply	other threads:[~2017-10-17 15:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-15 10:02 Bug: git ls-remote -h / --head results differ in output Thomas Rikl
2017-10-15 11:08 ` Martin Ågren
2017-10-15 13:26   ` René Scharfe
2017-10-17 15:39     ` [PATCH 1/2] git: add NO_INTERNAL_HELP flag for builtins René Scharfe
2017-10-17 17:39       ` Jonathan Nieder
2017-10-17 15:39     ` [PATCH 2/2] ls-remote: use PARSE_OPT_NO_INTERNAL_HELP René Scharfe
2017-10-17 17:42       ` Jonathan Nieder
2017-10-17 17:42       ` Martin Ågren
2017-10-17 15:39     ` René Scharfe [this message]
2017-10-17 17:40       ` [Alt. PATCH] ls-remote: deprecate -h as short for --heads Martin Ågren
2017-10-17 17:43       ` Jonathan Nieder
2017-10-17 23:22       ` Junio C Hamano
2017-10-19 18:26         ` René Scharfe
2017-10-19 20:32           ` Jeff King
2017-10-20  1:04             ` Junio C Hamano
2017-10-20  3:05               ` Jeff King
2017-10-20  5:35                 ` Junio C Hamano
2017-10-21  7:16                   ` Jeff King
2017-10-21 10:14                   ` René Scharfe
2017-10-21 12:18                     ` Junio C Hamano
2017-10-23 15:05                       ` René Scharfe
2017-10-24  0:52                         ` Junio C Hamano
2017-10-24 18:26                           ` René Scharfe

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

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

  git send-email \
    --in-reply-to=774f08bd-3172-0083-1544-e5f68f6798fa@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=martin.agren@gmail.com \
    --cc=peff@peff.net \
    --cc=t.gummerer@gmail.com \
    --cc=trikl@online.de \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.