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

Re: [PATCH] merge-recursive: remove superfluous semicolon

From
Elijah Newren <newren@gmail.com>
Date
Sep 5, 2018, 17:03 UTC
Message-ID
<20180905170308.32017-1-newren@gmail.com>
In-Reply-To
<CACsJy8Cf5+3+6yDwe4Y4wYLze4Y6naW-pj134KTpXM+wyWbFVQ@mail.gmail.com>
On Wed, Sep 5, 2018 at 9:55 AM Duy Nguyen <pclouds@gmail.com> wrote:
Show 15 quoted lines
>
> On Wed, Sep 5, 2018 at 6:49 PM Elijah Newren <newren@gmail.com> wrote:
> >
> > Signed-off-by: Elijah Newren <newren@gmail.com>
> > ---
> > Once I saw it, I couldn't unsee it, and it quickly started getting on my
> > nerves...
>
> Bad Elijah! Should have grepped and fixed all three ;-)
>
> $ git grep ';;$' -- '*.c'
> builtin/receive-pack.c: hmac_sha1(sha1, buf.buf, buf.len,
> cert_nonce_seed, strlen(cert_nonce_seed));;
> merge-recursive.c:      struct dir_rename_entry *entry = NULL;;
> remote-curl.c:          options.filter = xstrdup(value);;

Whoops, indeed. I didn't think about the fact that the same problem might appear in some other file. Anyway, here's the extended fix.

-- 8< --
Subject: [PATCH] Remove superfluous trailing semicolons
Signed-off-by: Elijah Newren <newren@gmail.com>
---
 builtin/receive-pack.c | 2 +-
 merge-recursive.c      | 2 +-
 remote-curl.c          | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index c17ce94e12..a8423a940f 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -465,7 +465,7 @@ static char *prepare_push_cert_nonce(const char *path, timestamp_t stamp)
 	unsigned char sha1[GIT_SHA1_RAWSZ];
 
 	strbuf_addf(&buf, "%s:%"PRItime, path, stamp);
-	hmac_sha1(sha1, buf.buf, buf.len, cert_nonce_seed, strlen(cert_nonce_seed));;
+	hmac_sha1(sha1, buf.buf, buf.len, cert_nonce_seed, strlen(cert_nonce_seed));
 	strbuf_release(&buf);
 
 	/* RFC 2104 5. HMAC-SHA1-80 */
diff --git a/merge-recursive.c b/merge-recursive.c
index e5243dbc54..1b5c255918 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -2239,7 +2239,7 @@ static struct dir_rename_entry *check_dir_renamed(const char *path,
 {
 	char *temp = xstrdup(path);
 	char *end;
-	struct dir_rename_entry *entry = NULL;;
+	struct dir_rename_entry *entry = NULL;
 
 	while ((end = strrchr(temp, '/'))) {
 		*end = '\0';
diff --git a/remote-curl.c b/remote-curl.c
index fb28309e85..762a55a75f 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -178,7 +178,7 @@ static int set_option(const char *name, const char *value)
 		options.no_dependents = 1;
 		return 0;
 	} else if (!strcmp(name, "filter")) {
-		options.filter = xstrdup(value);;
+		options.filter = xstrdup(value);
 		return 0;
 	} else {
 		return 1 /* unsupported */;
-- 
2.19.0.rc2.2.g1aedc61e22
Previous: Duy Nguyen
Message 3 of 3 in “merge-recursive: remove superfluous semicolon”
  1. merge-recursive: remove superfluous semicolonElijah Newren, Sep 5, 2018
  2. Duy NguyenSep 5, 2018
  3. Elijah NewrenSep 5, 2018

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.