git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: ZheNing Hu <adlternative@gmail.com>
To: Teng Long <dyroneteng@gmail.com>
Cc: git@vger.kernel.org, --cc=avarab@gmail.com,
	tenglong.tl@alibaba-inc.com, me@ttaylorr.com
Subject: Re: [RFC PATCH 1/1] push: introduce '--heads' option
Date: Mon, 5 Dec 2022 22:23:38 +0800	[thread overview]
Message-ID: <CAOLTT8QcvPfXKap2aa6iyi0jq-cySL=XjDP2G2wG8m57=u0aGw@mail.gmail.com> (raw)
In-Reply-To: <20221205133525.60464-2-tenglong.tl@alibaba-inc.com>

Hi,

Teng Long <dyroneteng@gmail.com> 于2022年12月5日周一 21:44写道:
>
> From: Teng Long <dyroneteng@gmail.com>
>
> The '--all' option of git-push built-in cmd support to push all branches
> (refs under refs/heads) to remote. Under the usage, a user can easlily
> work in some scenarios, for example, branches synchronization and batch
> upload.
>
> '--all' was introduced for a long time, meanwhile, git supports to
> customize the storage location under "refs/". when a new git user see
> the usage like, 'git push origin --all', we might feel like we're
> pushing _all_ the refs instead of just branches without looking at the
> documents until we found the related description of it or '--mirror'.
>

"--all" sounds like it will include all things: branches, tags, but it only
includes branches under ref/heads/, which does cause a little confusion
for users.

> To ensure compatibility, we cannot rename '--all' to another name
> directly, one way is, we can try to add a new option '--heads' which be
> identical with the functionality of '--all' to let the user understand
> the meaning of representation more clearly. Actually, We've more or less
> named options this way already, for example, in 'git-show-ref' and 'git
> ls-remote'.
>
> At the same time, we fix a related issue about the wrong help
> information of '--all' option in code.
>
> Signed-off-by: Teng Long <dyroneteng@gmail.com>
> ---
>  Documentation/git-push.txt |  1 +
>  builtin/push.c             | 13 +++++++------
>  t/t5523-push-upstream.sh   | 19 ++++++++++++-------
>  3 files changed, 20 insertions(+), 13 deletions(-)
>
> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
> index 5bb1d5aae25..a5d18fb90b6 100644
> --- a/Documentation/git-push.txt
> +++ b/Documentation/git-push.txt
> @@ -147,6 +147,7 @@ already exists on the remote side.
>  `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
>
>  --all::
> +--heads::
>         Push all branches (i.e. refs under `refs/heads/`); cannot be
>         used with other <refspec>.
>
> diff --git a/builtin/push.c b/builtin/push.c
> index 60ac8017e52..970cabaa78b 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -588,11 +588,12 @@ int cmd_push(int argc, const char **argv, const char *prefix)
>         struct option options[] = {
>                 OPT__VERBOSITY(&verbosity),
>                 OPT_STRING( 0 , "repo", &repo, N_("repository"), N_("repository")),
> -               OPT_BIT( 0 , "all", &flags, N_("push all refs"), TRANSPORT_PUSH_ALL),
> +               OPT_BIT( 0 , "all", &flags, N_("push all branches"), TRANSPORT_PUSH_ALL),
> +               OPT_BIT( 0 , "heads", &flags, N_("push all branches"), TRANSPORT_PUSH_ALL),

Maybe OPT_ALIAS() will be better?

  reply	other threads:[~2022-12-05 14:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 13:35 [RFC PATCH 0/1] push: introduce '--heads' option Teng Long
2022-12-05 13:35 ` [RFC PATCH 1/1] " Teng Long
2022-12-05 14:23   ` ZheNing Hu [this message]
2022-12-06 12:18     ` Teng Long
2023-04-28 12:21   ` Felipe Contreras
2023-04-30  1:05     ` Teng Long
2023-05-06 11:27   ` [PATCH 0/1] push: introduce '--branches' option Teng Long
2023-05-06 11:27     ` [PATCH 1/1] " Teng Long
2023-05-06 11:36     ` [PATCH 0/1] " Teng Long
2022-12-05 23:35 ` [RFC PATCH 0/1] push: introduce '--heads' option Junio C Hamano
2022-12-15 12:27   ` Teng Long
2023-04-28  9:59   ` Teng Long
2023-04-28 18:48     ` Junio C Hamano
2023-04-30  1:09       ` Teng Long
2023-05-06 11:34 ` [PATCH 0/1] push: introduce '--branches' option Teng Long
2023-05-06 11:34   ` [PATCH 1/1] " Teng Long
2023-05-06 21:39     ` Junio C Hamano
2023-05-07  6:43       ` Teng Long

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='CAOLTT8QcvPfXKap2aa6iyi0jq-cySL=XjDP2G2wG8m57=u0aGw@mail.gmail.com' \
    --to=adlternative@gmail.com \
    --cc=--cc=avarab@gmail.com \
    --cc=dyroneteng@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=tenglong.tl@alibaba-inc.com \
    /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).