threads / patch / 38441

patch, 7 partsCoding style fixes.

Subject: [PATCH 0/7] Coding style fixes.

## tl;dr

11 messages between Jan 23, 2015 and Jan 23, 2015. Diffs are folded; open one to read it.

replies: 10people: 3as markdown or json

Alexander Kuleshov· Jan 23, 2015, 11:06 UTC · lore

This patch set contatins minor style fixes. CodingGuidelines contains rule that the star must side with variable name.

Alexander Kuleshov (7):
  show-branch: minor style fix
  clone: minor style fix
  test-hashmap: minor style fix
  http-backend: minor style fix
  refs: minor style fix
  quote: minor style fix
  fast-import: minor style fix
 builtin/clone.c       | 2 +-
 builtin/show-branch.c | 2 +-
 fast-import.c         | 2 +-
 http-backend.c        | 2 +-
 quote.c               | 2 +-
 refs.h                | 2 +-
 test-hashmap.c        | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

-- 2.3.0.rc1.275.g028c360

Alexander Kuleshov· Jan 23, 2015, 11:07 UTC · re: Alexander Kuleshov · lore

[PATCH 1/7] show-branch: minor style fix

Asterisk must be next with variable
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 builtin/show-branch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to builtin/show-branch.c +1 −2
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 3a7ec55..e7684c8 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -6,7 +6,7 @@
 #include "parse-options.h"
 #include "commit-slab.h"

-static const char* show_branch_usage[] = {
+static const char *show_branch_usage[] = {
     N_("git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
        "		[--current] [--color[=<when>] | --no-color] [--sparse]\n"
        "		[--more=<n> | --list | --independent | --merge-base]\n"
--
2.3.0.rc1.275.g028c360
Alexander Kuleshov· Jan 23, 2015, 11:08 UTC · re: Alexander Kuleshov · lore

[PATCH 2/7] clone: minor style fix

Asterisk must be next with variable
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 builtin/clone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to builtin/clone.c +1 −2
diff --git a/builtin/clone.c b/builtin/clone.c
index d262a4d..a1ca780 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -741,7 +741,7 @@ static void write_refspec_config(const char *src_ref_prefix,

 static void dissociate_from_references(void)
 {
-	static const char* argv[] = { "repack", "-a", "-d", NULL };
+	static const char *argv[] = { "repack", "-a", "-d", NULL };

 	if (run_command_v_opt(argv, RUN_GIT_CMD|RUN_COMMAND_NO_STDIN))
 		die(_("cannot repack to clean up"));
--
2.3.0.rc1.275.g028c360
Alexander Kuleshov· Jan 23, 2015, 11:08 UTC · re: Alexander Kuleshov · lore

[PATCH 3/7] test-hashmap: minor style fix

Asterisk must be next with variable
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 test-hashmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to test-hashmap.c +2 −3
diff --git a/test-hashmap.c b/test-hashmap.c
index cc2891d..5f67120 100644
--- a/test-hashmap.c
+++ b/test-hashmap.c
@@ -14,13 +14,13 @@ static const char *get_value(const struct test_entry *e)
 }

 static int test_entry_cmp(const struct test_entry *e1,
-		const struct test_entry *e2, const char* key)
+		const struct test_entry *e2, const char *key)
 {
 	return strcmp(e1->key, key ? key : e2->key);
 }

 static int test_entry_cmp_icase(const struct test_entry *e1,
-		const struct test_entry *e2, const char* key)
+		const struct test_entry *e2, const char *key)
 {
 	return strcasecmp(e1->key, key ? key : e2->key);
 }
--
2.3.0.rc1.275.g028c360
Alexander Kuleshov· Jan 23, 2015, 11:08 UTC · re: Alexander Kuleshov · lore

[PATCH 4/7] http-backend: minor style fix

Asterisk must be next with variable
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 http-backend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to http-backend.c +1 −2
diff --git a/http-backend.c b/http-backend.c
index b6c0484..7b5670b 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -515,7 +515,7 @@ static NORETURN void die_webcgi(const char *err, va_list params)
 	exit(0); /* we successfully reported a failure ;-) */
 }

-static char* getdir(void)
+static char *getdir(void)
 {
 	struct strbuf buf = STRBUF_INIT;
 	char *pathinfo = getenv("PATH_INFO");
--
2.3.0.rc1.275.g028c360
Alexander Kuleshov· Jan 23, 2015, 11:08 UTC · re: Alexander Kuleshov · lore

[PATCH 5/7] refs: minor style fix

Asterisk must be next with variable
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 refs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to refs.h +1 −2
diff --git a/refs.h b/refs.h
index 425ecf7..bd8afe2 100644
--- a/refs.h
+++ b/refs.h
@@ -86,7 +86,7 @@ extern int for_each_branch_ref(each_ref_fn, void *);
 extern int for_each_remote_ref(each_ref_fn, void *);
 extern int for_each_replace_ref(each_ref_fn, void *);
 extern int for_each_glob_ref(each_ref_fn, const char *pattern, void *);
-extern int for_each_glob_ref_in(each_ref_fn, const char *pattern, const char* prefix, void *);
+extern int for_each_glob_ref_in(each_ref_fn, const char *pattern, const char *prefix, void *);

 extern int head_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data);
 extern int for_each_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data);
--
2.3.0.rc1.275.g028c360
Alexander Kuleshov· Jan 23, 2015, 11:08 UTC · re: Alexander Kuleshov · lore

[PATCH 6/7] quote: minor style fix

Asterisk must be next with variable
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 quote.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to quote.c +1 −2
diff --git a/quote.c b/quote.c
index 7920e18..02e9a3c 100644
--- a/quote.c
+++ b/quote.c
@@ -42,7 +42,7 @@ void sq_quote_buf(struct strbuf *dst, const char *src)
 	free(to_free);
 }

-void sq_quote_argv(struct strbuf *dst, const char** argv, size_t maxlen)
+void sq_quote_argv(struct strbuf *dst, const char **argv, size_t maxlen)
 {
 	int i;

--
2.3.0.rc1.275.g028c360
Alexander Kuleshov· Jan 23, 2015, 11:08 UTC · re: Alexander Kuleshov · lore

[PATCH 7/7] fast-import: minor style fix

Asterisk must be next with variable
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 fast-import.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to fast-import.c +1 −2
diff --git a/fast-import.c b/fast-import.c
index 1b50923..fec67ca 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -3110,7 +3110,7 @@ static void parse_progress(void)
 	skip_optional_lf();
 }

-static char* make_fast_import_path(const char *path)
+static char *make_fast_import_path(const char *path)
 {
 	if (!relative_marks_paths || is_absolute_path(path))
 		return xstrdup(path);
--
2.3.0.rc1.275.g028c360
Torsten Bögershausen· Jan 23, 2015, 12:22 UTC · re: Alexander Kuleshov · lore

Re: [PATCH 7/7] fast-import: minor style fix

On 2015-01-23 12.08, Alexander Kuleshov wrote: .. Asterisk must be next with variable .. But this is a function:

> -static char* make_fast_import_path(const char *path)
> +static char *make_fast_import_path(const char *path)
(Sorry when I need to read this:)
 - Fixing style violations while working on a real change as a
   preparatory clean-up step is good, but otherwise avoid useless code
   churn for the sake of conforming to the style.
   "Once it _is_ in the tree, it's not really worth the patch noise to
   go and fix it up."
   Cf. http://article.gmane.org/gmane.linux.kernel/943020
Alexander Kuleshov· Jan 23, 2015, 12:09 UTC · re: Alexander Kuleshov · lore

Re: [PATCH 0/7] Coding style fixes.

I made separate patch for every file. Please, let me know if need to squash it into one commit.

2015-01-23 17:06 GMT+06:00 Alexander Kuleshov <kuleshovmail@gmail.com>:
Show 23 quoted lines
> This patch set contatins minor style fixes. CodingGuidelines contains
> rule that the star must side with variable name.
>
> Alexander Kuleshov (7):
>   show-branch: minor style fix
>   clone: minor style fix
>   test-hashmap: minor style fix
>   http-backend: minor style fix
>   refs: minor style fix
>   quote: minor style fix
>   fast-import: minor style fix
>
>  builtin/clone.c       | 2 +-
>  builtin/show-branch.c | 2 +-
>  fast-import.c         | 2 +-
>  http-backend.c        | 2 +-
>  quote.c               | 2 +-
>  refs.h                | 2 +-
>  test-hashmap.c        | 4 ++--
>  7 files changed, 8 insertions(+), 8 deletions(-)
>
> --
> 2.3.0.rc1.275.g028c360
-- 
_________________________
0xAX
Stefan Beller· Jan 23, 2015, 18:36 UTC · re: Alexander Kuleshov · lore

Re: [PATCH 0/7] Coding style fixes.

On Fri, Jan 23, 2015 at 4:09 AM, Alexander Kuleshov <kuleshovmail@gmail.com> wrote:

Show 8 quoted lines
> I made separate patch for every file. Please, let me know if need to
> squash it into one commit.
>
>
> 2015-01-23 17:06 GMT+06:00 Alexander Kuleshov <kuleshovmail@gmail.com>:
>> This patch set contatins minor style fixes. CodingGuidelines contains
>> rule that the star must side with variable name.
>>
The whole series is
Reviewed-by: Stefan Beller <sbeller@google.com>

← back to recent threads