From: Michael J Gruber <git@drmicha.warpmail.net>
To: Stephen Boyd <bebarino@gmail.com>
Cc: git@vger.kernel.org, Johan Herland <johan@herland.net>
Subject: Re: [PATCH] notes: dry-run and verbose options for prune
Date: Sun, 16 May 2010 15:53:30 +0200 [thread overview]
Message-ID: <4BEFF8DA.502@drmicha.warpmail.net> (raw)
In-Reply-To: <4BEF1D93.7070305@gmail.com>
Stephen Boyd venit, vidit, dixit 16.05.2010 00:17:
> On 05/14/2010 02:42 PM, Michael J Gruber wrote:
>> @@ -792,7 +792,10 @@ static int remove_cmd(int argc, const char **argv, const char *prefix)
>> static int prune(int argc, const char **argv, const char *prefix)
>> {
>> struct notes_tree *t;
>> + int show_only, verbose;
>> struct option options[] = {
>> + OPT_BOOLEAN('n', NULL, &show_only, "do not remove, show only"),
>> + OPT_BOOLEAN('v', NULL, &verbose, "report pruned notes"),
>> OPT_END()
>> };
>>
>
> Why not use the standard OPT__DRY_RUN and OPT__VERBOSE macros?
Because of the part you cut out: complete analogy with "git prune".
I don't mind using the OPT__ions, but suggest that unification as a
separate task (involving all occurences of -v and -n, not just this one).
>
> ---->8----
>
> diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt
> index 0f32792..6e53c9a 100644
> --- a/Documentation/git-notes.txt
> +++ b/Documentation/git-notes.txt
> @@ -122,10 +122,12 @@ OPTIONS
> is taken to be in `refs/notes/` if it is not qualified.
>
> -n::
> +--dry-run::
> Do not remove anything; just report the object names whose notes
> would be removed.
>
> -v::
> +--verbose::
> Report all object names whose notes are removed.
>
>
> diff --git a/builtin/notes.c b/builtin/notes.c
> index 8c2ac51..0ae2561 100644
> --- a/builtin/notes.c
> +++ b/builtin/notes.c
> @@ -794,8 +794,8 @@ static int prune(int argc, const char **argv, const char *pr
> struct notes_tree *t;
> int show_only, verbose;
> struct option options[] = {
> - OPT_BOOLEAN('n', NULL, &show_only, "do not remove, show only"),
> - OPT_BOOLEAN('v', NULL, &verbose, "report pruned notes"),
> + OPT__DRY_RUN(&show_only),
> + OPT__VERBOSE(&verbose),
> OPT_END()
> };
>
>
>
prev parent reply other threads:[~2010-05-16 13:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-14 21:42 [PATCH] notes: dry-run and verbose options for prune Michael J Gruber
2010-05-14 23:38 ` Johan Herland
2010-05-15 22:17 ` Stephen Boyd
2010-05-16 13:53 ` Michael J Gruber [this message]
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=4BEFF8DA.502@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=bebarino@gmail.com \
--cc=git@vger.kernel.org \
--cc=johan@herland.net \
/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 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 NNTP newsgroup(s).