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

Re: [PATCH v1] builtin/merge.c - cleanup of code in for-cycle that tests strategies

From
Edmundo Carmona Antoranz <eantoranz@gmail.com>
Date
Jul 8, 2019, 20:52 UTC
Message-ID
<CAOc6etbwHAAFSM-GwuD8BaC76EQNv+pQ5TgNCWN65DhNfV3KEw@mail.gmail.com>
In-Reply-To
<xmqqh87wxoza.fsf@gitster-ct.c.googlers.com>
On Mon, Jul 8, 2019 at 2:15 PM Junio C Hamano <gitster@pobox.com> wrote:
> In the body of the proposed commit log message, please finish each
> sentence with a full-stop.
Ok
>
> These bullets are all subjective, and do not add any value to what
> you already said in the second sentence.
Ok
Show 17 quoted lines
>
> These are facts that readers can see for themselves and agree with.
>
> Something like...
>
>         The cmd_merge() function has a loop that tries different
>         merge strategies in turn, and stops when a strategy gets a
>         clean merge, while keeping the "best" conflicted merge so
>         far.
>
>         Make the loop easier to follow by moving the code around,
>         ensuring that there is only one "break" in the loop where
>         an automerge succeeds.  Also group the actions that are
>         performed after an automerge succeeds together to a single
>         location, outside and after the loop.
>
> perhaps?
I like it.
> > +                     int cnt = evaluate_result();
> This introduces -Wdeclaration-after-statement, doesn't it?

It does! Let me take care of it. (Didn't know about DEVELOPER environment variable up until... 5 minutes ago?)

> Perhaps just declare the variable at the top of the for loop, next
> to where the local 'ret' is declared?
Yep, make sense
>
> Other than this single glitch, I think the code with this patch does
> become easier to follow.
Great!
Let me come back with v2 during the day.
Thanks!
Previous: Junio C Hamano
Message 4 of 4 in “builtin/merge.c - cleanup of code in for-cycle that tests strategies”
  1. builtin/merge.c - cleanup of code in for-cycle that tests strategiesEdmundo Carmona Antoranz, Jul 7, 2019
  2. Edmundo Carmona AntoranzJul 7, 2019
  3. Junio C HamanoJul 8, 2019
  4. Edmundo Carmona AntoranzJul 8, 2019

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.