From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Stefan Beller" <sbeller@google.com>,
"Git List" <git@vger.kernel.org>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH] worktree: accept -f as short for --force for removal
Date: Wed, 18 Apr 2018 09:17:59 +0900 [thread overview]
Message-ID: <xmqq4lk9l64o.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAPig+cTgoD-GvpoBQ6tcGX4T2XhuKccJAZ40P76vxVD_PfEc9A@mail.gmail.com> (Eric Sunshine's message of "Tue, 17 Apr 2018 14:46:49 -0400")
Eric Sunshine <sunshine@sunshineco.com> writes:
> On Tue, Apr 17, 2018 at 2:19 PM, Stefan Beller <sbeller@google.com> wrote:
>> The force flag is very common in many commands and is commonly
>> abbreviated with '-f', so add that to worktree removal, too by using
>> OPT__FORCE instead of a self cooked OPT_BOOL for force.
>
> The missing bit of this sentence:
>
> ...self cooked OPT_BOOL for force which forgets '-f'.
>
>> While at it, add the PARSE_OPT_NOCOMPLETE flag to the force command line
>> option as forcing a removal may lose files.
>>
>> The short form of "-f" is already documented in the man page,
>> so we do not have to adjust the docs.
>
> Makes sense. A possible rewrite (of the entire commit message):
>
> worktree: remove: recognize -f as short for --force
>
> Many commands support a --force option, frequently abbreviated as
> -f, however, "git worktree remove"'s hand-rolled OPT_BOOL forgets
> to recognize the short form, despite git-worktree.txt documenting
> -f as supported. Replace OPT_BOOL with OPT__FORCE, which provides
> -f for free, and makes 'remove' consistent with 'add' option
> parsing (which also specifies the PARSE_OPT_NOCOMPLETE flag).
>
>> Helped-by: Eric Sunshine <sunshine@sunshineco.com>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
Looks better. I am not sure if s/--force/-f/ in the synopsis
section is warranted, but '-f' is commonly understood as '--force'
(and that is the point of this patch after all), so it is probably
an improvement to be briefer.
Thanks, both.
>
> The patch itself looks good. Thanks. With or without the above rewrite
> or minor adjustment, this patch is:
>
> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
next prev parent reply other threads:[~2018-04-18 0:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 22:16 [PATCH] worktree: accept -f as short for --force for removal Stefan Beller
2018-04-17 0:21 ` Eric Sunshine
2018-04-17 18:19 ` Stefan Beller
2018-04-17 18:46 ` Eric Sunshine
2018-04-18 0:17 ` Junio C Hamano [this message]
2018-04-18 5:01 ` 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=xmqq4lk9l64o.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=sbeller@google.com \
--cc=sunshine@sunshineco.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).