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

Re: [PATCH] Speed up commands that use rev-list when max-count is specified.

From
Mark Lodato <lodatom@gmail.com>
Date
Mar 21, 2010, 14:09 UTC
Message-ID
<ca433831003210709k1da46c8docfdac358253625e@mail.gmail.com>
In-Reply-To
<1269142267-17127-1-git-send-email-bmeyer@rim.com>
On Sat, Mar 20, 2010 at 11:31 PM, Benjamin C Meyer <bmeyer@rim.com> wrote:
Show 7 quoted lines
>  struct commit *get_revision(struct rev_info *revs)
>  {
> +       if (revs->max_count == 0)
> +               return NULL;
> +
>        struct commit *c;
>        struct commit_list *reversed;

Declaring variables in the middle of a function is a C99 feature (and a GNU extension in C89 mode). I don't know if this is allowed in git code, but it would be easy enough to make this ANSI C89 compatible by putting your new statement after the variable declarations.

Previous: Benjamin Meyer
Message 4 of 4 in “Speed up commands that use rev-list when max-count is specified.”
  1. Speed up commands that use rev-list when max-count is specified.Benjamin C Meyer, Mar 21, 2010
  2. Sverre RabbelierMar 21, 2010
  3. Benjamin MeyerMar 21, 2010
  4. Mark LodatoMar 21, 2010

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.