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

Re: [PATCH 5/5] builtin/commit.c: reduce scope of variables

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jan 29, 2014, 20:17 UTC
Message-ID
<CAPig+cR3DdPS3W_FNPnXG+NO0gUG2PSLH0qNmFUsoxJcy0MVsQ@mail.gmail.com>
In-Reply-To
<1391003311-11126-1-git-send-email-gitter.spiros@gmail.com>
On Wed, Jan 29, 2014 at 8:48 AM, Elia Pinto <gitter.spiros@gmail.com> wrote:
Show 17 quoted lines
> diff --git a/builtin/commit.c b/builtin/commit.c
> index 3767478..eea4421 100644
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -1510,7 +1511,6 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
>         struct ref_lock *ref_lock;
>         struct commit_list *parents = NULL, **pptr = &parents;
>         struct stat statbuf;
> -       int allow_fast_forward = 1;
>         struct commit *current_head = NULL;
>         struct commit_extra_header *extra = NULL;
>
> @@ -1576,6 +1576,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
>                 }
>                 fclose(fp);
>                 strbuf_release(&m);
> +               int allow_fast_forward = 1;

This introduces a declaration-after-statement, which is frowned upon in this project.

Show 5 quoted lines
>                 if (!stat(git_path("MERGE_MODE"), &statbuf)) {
>                         if (strbuf_read_file(&sb, git_path("MERGE_MODE"), 0) < 0)
>                                 die_errno(_("could not read MERGE_MODE"));
> --
> 1.7.10.4
Previous: Elia Pinto
Message 2 of 2 in “builtin/commit.c: reduce scope of variables”
  1. 5/5 builtin/commit.c: reduce scope of variablesElia Pinto, Jan 29, 2014
  2. Eric SunshineJan 29, 2014

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.