git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Elia Pinto <gitter.spiros@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] worktree: add --quiet option
Date: Tue, 7 Aug 2018 17:30:04 +0200	[thread overview]
Message-ID: <CACsJy8A=zp7nFBuWyfeP4UFf3KSsiaor3m0mtgVnhcEYHSw4HA@mail.gmail.com> (raw)
In-Reply-To: <20180807132113.118297-1-gitter.spiros@gmail.com>

On Tue, Aug 7, 2018 at 3:27 PM Elia Pinto <gitter.spiros@gmail.com> wrote:
>
> Add the '--quiet' option to git worktree add,
> as for the other git commands.
>
> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
> ---
>  Documentation/git-worktree.txt |  4 +++-
>  builtin/worktree.c             | 11 +++++++++--
>  2 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
> index 9c26be40f..508cde55c 100644
> --- a/Documentation/git-worktree.txt
> +++ b/Documentation/git-worktree.txt
> @@ -115,7 +115,9 @@ Unlock a working tree, allowing it to be pruned, moved or deleted.
>
>  OPTIONS
>  -------
> -
> +-q::
> +--quiet::
> +       With 'add', suppress feedback messages.

Should we update the synopsis as well?

> @@ -315,6 +316,9 @@ static int add_worktree(const char *path, const char *refname,

Before here we run either update-ref or symbolic-ref. update-ref does
not have --quiet so it's fine, no need to add another option there
(until it shows something when used with "worktree add --quiet") but
symbolic-ref seems to support -q. Should we pass -q to it?

>                 cp.argv = NULL;
>                 argv_array_clear(&cp.args);
>                 argv_array_pushl(&cp.args, "reset", "--hard", NULL);
> +               if (opts->quiet)
> +                       argv_array_push(&cp.args, "--quiet");
> +               printf("%s\n","soo qia");
>                 cp.env = child_env.argv;
>                 ret = run_command(&cp);
>                 if (ret)
> @@ -437,6 +441,7 @@ static int add(int ac, const char **av, const char *prefix)
>                 OPT_BOOL(0, "detach", &opts.detach, N_("detach HEAD at named commit")),
>                 OPT_BOOL(0, "checkout", &opts.checkout, N_("populate the new working tree")),
>                 OPT_BOOL(0, "lock", &opts.keep_locked, N_("keep the new working tree locked")),
> +               OPT__QUIET(&opts.quiet, N_("suppress progress reporting")),

git grep OPT__QUIET shows that we have plenty different messages to
describe --quiet. But yeah "support progress reporting" seems close
enough in this context.

>                 OPT_PASSTHRU(0, "track", &opt_track, NULL,
>                              N_("set up tracking mode (see git-branch(1))"),
>                              PARSE_OPT_NOARG | PARSE_OPT_OPTARG),

The rest looks good.
-- 
Duy

  parent reply	other threads:[~2018-08-07 15:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 13:21 [PATCH] worktree: add --quiet option Elia Pinto
2018-08-07 14:37 ` Martin Ågren
2018-08-07 15:46   ` Elia Pinto
2018-08-07 15:30 ` Duy Nguyen [this message]
2018-08-07 19:12 ` Eric Sunshine

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='CACsJy8A=zp7nFBuWyfeP4UFf3KSsiaor3m0mtgVnhcEYHSw4HA@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitter.spiros@gmail.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).