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

Re: [PATCH] Trivial fix: Make all the builtin usage strings to use the same pattern.

From
BCBrandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
Date
Sep 21, 2009, 15:28 UTC
Message-ID
<pN7ragma8Ra75P8lN7iHuXE6FyUXHXFlnHUVFZqJV4WM7w5mCkVHcQ@cipher.nrlssc.navy.mil>
In-Reply-To
<1253452645-3220-1-git-send-email-tfransosi@gmail.com>
Thiago Farina wrote:
Show 6 quoted lines
> They follow the pattern of file name:
> File name pattern: builtin-command-name.c
> Usage string pattern: builtin_command_name_usage
> 
> Signed-off-by: Thiago Farina <tfransosi@gmail.com>
> ---
Show 10 quoted lines
> diff --git a/builtin-blame.c b/builtin-blame.c
> index 7512773..4adae84 100644
> --- a/builtin-blame.c
> +++ b/builtin-blame.c
> @@ -21,10 +21,11 @@
>  #include "parse-options.h"
>  #include "utf8.h"
>  
> -static char blame_usage[] = "git blame [options] [rev-opts] [rev] [--] file";
> +static char builtin_blame_usage[] =
Should this one also use 'const'?
Show 8 quoted lines
> +"git blame [options] [rev-opts] [rev] [--] file";
>  
>  static const char *blame_opt_usage[] = {
> -	blame_usage,
> +	builtin_blame_usage,
>  	"",
>  	"[rev-opts] are documented in git-rev-list(1)",
>  	NULL
Show 10 quoted lines
> diff --git a/builtin-count-objects.c b/builtin-count-objects.c
> index 1b0b6c8..fbe0972 100644
> --- a/builtin-count-objects.c
> +++ b/builtin-count-objects.c
> @@ -65,7 +65,7 @@ static void count_objects(DIR *d, char *path, int len, int verbose,
>  	}
>  }
>  
> -static char const * const count_objects_usage[] = {
> +static char const * const builtin_count_objects_usage[] = {

This one is different from the others. I assume 'char const *' is the same as 'const char *', though I'm used to seeing the latter form. If we're going for consistency, maybe this should be changed too. Ultra minor nit-pick. I noticed it, so I mentioned it, but its your choice.

>  	"git count-objects [-v]",
>  	NULL
>  };
Show 10 quoted lines
> diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
> index a5a83f1..715d378 100644
> --- a/builtin-for-each-ref.c
> +++ b/builtin-for-each-ref.c
> @@ -881,7 +881,7 @@ static int opt_parse_sort(const struct option *opt, const char *arg, int unset)
>  	return 0;
>  }
>  
> -static char const * const for_each_ref_usage[] = {
> +static char const * const builtin_for_each_ref_usage[] = {
ditto
>  	"git for-each-ref [options] [<pattern>]",
>  	NULL
>  };
Show 10 quoted lines
> diff --git a/builtin-fsck.c b/builtin-fsck.c
> index c58b0e3..0857357 100644
> --- a/builtin-fsck.c
> +++ b/builtin-fsck.c
> @@ -564,7 +564,7 @@ static int fsck_cache_tree(struct cache_tree *it)
>  	return err;
>  }
>  
> -static char const * const fsck_usage[] = {
> +static char const * const builtin_fsck_usage[] = {
ditto
>  	"git fsck [options] [<object>...]",
>  	NULL
>  };
Previous: Thiago FarinaNext: Thiago Farina
Message 4 of 7 in “Trivial fix: Make all the builtin usage strings to use the same pattern.”
  1. Trivial fix: Make all the builtin usage strings to use the same pattern.Thiago Farina, Sep 20, 2009
  2. Johannes GilgerSep 20, 2009
  3. Thiago FarinaSep 20, 2009
  4. Brandon CaseySep 21, 2009
  5. Thiago FarinaSep 21, 2009
  6. Johannes SixtSep 21, 2009
  7. Thiago FarinaSep 21, 2009

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.