Thread (7 messages) flat view 7 messages, 4 authors, 2016-06-15

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

From: Thiago Farina <hidden>
Date: 2016-06-15 22:47:26

On Mon, Sep 21, 2009 at 12:28 PM, Brandon Casey
[off-list ref] wrote:
Thiago Farina wrote:
quoted
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 <redacted>
---
quoted
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'?
It can use const here. I will do this change in the next patch.
quoted
+"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
quoted
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.
To maintain the consistency I will follow the latter form, since all
others are using "const char *".
Thanks for catching the ones that I missed. I will update them in the
next patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help