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

Re: [PATCH] update-ref: whitespace fix

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 25, 2011, 21:48 UTC
Message-ID
<7vliuhi2nb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1314286850-11080-1-git-send-email-pangyanhan@gmail.com>
pangyanhan@gmail.com writes:
Show 17 quoted lines
> From: Pang Yan Han <pangyanhan@gmail.com>
>
> Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
> ---
>  builtin/update-ref.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/builtin/update-ref.c b/builtin/update-ref.c
> index 76ba1d5..835c62a 100644
> --- a/builtin/update-ref.c
> +++ b/builtin/update-ref.c
> @@ -11,7 +11,7 @@ static const char * const git_update_ref_usage[] = {
>  
>  int cmd_update_ref(int argc, const char **argv, const char *prefix)
>  {
> -	const char *refname, *oldval, *msg=NULL;
> +	const char *refname, *oldval, *msg = NULL;
Heh, thanks. There are some more.
-- >8 --
Subject: [PATCH] whitespace: have SP on both sides of an assignment "="

I've deliberately excluded the borrowed code in compat/nedmalloc directory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/remote.c |    2 +-
 commit.c         |    2 +-
 http-push.c      |    2 +-
 read-cache.c     |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index 9ff1cac..1fb441c 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1113,7 +1113,7 @@ static int show(int argc, const char **argv)
 			url = states.remote->url;
 			url_nr = states.remote->url_nr;
 		}
-		for (i=0; i < url_nr; i++)
+		for (i = 0; i < url_nr; i++)
 			printf("  Push  URL: %s\n", url[i]);
 		if (!i)
 			printf("  Push  URL: %s\n", "(no URL)");
diff --git a/commit.c b/commit.c
index ac337c7..913dbab 100644
--- a/commit.c
+++ b/commit.c
@@ -515,7 +515,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
 
 		commit = work_item->item;
 		for (parents = commit->parents; parents ; parents = parents->next) {
-			struct commit *parent=parents->item;
+			struct commit *parent = parents->item;
 
 			if (!parent->indegree)
 				continue;
diff --git a/http-push.c b/http-push.c
index 6e8f6d0..376331a 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1655,7 +1655,7 @@ static int delete_remote_branch(const char *pattern, int force)
 		return error("Remote HEAD is not a symref");
 
 	/* Remote branch must not be the remote HEAD */
-	for (i=0; symref && i<MAXDEPTH; i++) {
+	for (i = 0; symref && i < MAXDEPTH; i++) {
 		if (!strcmp(remote_ref->name, symref))
 			return error("Remote branch %s is the current HEAD",
 				     remote_ref->name);
diff --git a/read-cache.c b/read-cache.c
index 4ac9a03..0a64103 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1087,7 +1087,7 @@ static void show_file(const char * fmt, const char * name, int in_porcelain,
 {
 	if (in_porcelain && *first && header_msg) {
 		printf("%s\n", header_msg);
-		*first=0;
+		*first = 0;
 	}
 	printf(fmt, name);
 }
-- 
1.7.6.1.385.gb7fcd0
Previous: pangyanhan@gmail.com
Message 2 of 2 in “update-ref: whitespace fix”
  1. update-ref: whitespace fixpangyanhan@gmail.com, Aug 25, 2011
  2. Junio C HamanoAug 25, 2011

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.