git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] notes: dry-run and verbose options for prune

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
May 16, 2010, 13:53 UTC
Message-ID
<4BEFF8DA.502@drmicha.warpmail.net>
In-Reply-To
<4BEF1D93.7070305@gmail.com>
Stephen Boyd venit, vidit, dixit 16.05.2010 00:17:
Show 14 quoted lines
> 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).

Show 37 quoted lines
> 
> ---->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()
>         };
>  
> 
> 
Previous: Stephen Boyd
Message 4 of 4 in “notes: dry-run and verbose options for prune”
  1. notes: dry-run and verbose options for pruneMichael J Gruber, May 14, 2010
  2. Johan HerlandMay 14, 2010
  3. Stephen BoydMay 15, 2010
  4. Michael J GruberMay 16, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.