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

Re: [PATCH] GSoC Change multiple if-else statements to be table-driven

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 17, 2014, 06:29 UTC
Message-ID
<CAPig+cSG0YsdTGWWyxWrg+s235qDe7Xr-jXT2mOkpvA6OaGWyg@mail.gmail.com>
In-Reply-To
<xmqqiorghgaj.fsf@gitster.dls.corp.google.com>
On Fri, Mar 14, 2014 at 12:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>> On Thu, Mar 13, 2014 at 4:20 PM, Yao Zhao <zhaox383@umn.edu> wrote:
>>> Subject: [PATCH] GSoC Change multiple if-else statements to be table-driven
>>
>> It's a good idea to let reviewers know that this is attempt 2. Do so
>> by saying [PATCH v2]. Your next one will be [PATCH v3]. The -v option
>> for "git format-email" can help.
>
> Yao, I think Eric meant "git format-patch".
Correct. Sorry for the confusion.
Show 13 quoted lines
>> An alternate approach might be to use a multi-dimensional array,
>> where the boolean values of rebasing, remote_is_branch, and origin
>> are keys into the array. This would allow you to pick out the
>> correct PRINT_LIST entry directly (no looping), thus eliminating
>> the need for those b_rebasing, b_remote_is_branch, and b_origin
>> members.
>
> Correct.
>
> After seeing so many "table driven" submissions, I however tend to
> agree with your earlier comment on another thread on this same
> micro, where you said an nested if-else cascade that was rewritten
> in a clearer way (sorry, I do not remember whose submission it was
It was Adam NoLastName [1].
[1]: http://thread.gmane.org/gmane.comp.version-control.git/243704
> offhand) may be the best answer to the "Would it make sense to make
> the code table-driven?" question, even though I tentatively queued
> d7ea7894 (install_branch_config(): simplify verbose messages logic,
> 2014-03-13) from Paweł on 'pu'.

Perhaps it is time to mark this microproject as "taken" on the GSoC page [2], along a fews others for which we have received multiple submissions.

[2]: https://github.com/git/git.github.io/blob/master/SoC-2014-Microprojects.md
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 13 in “SoC 2014 MicroProject No.8:change multiple if-else statement to table-driven approach”
  1. SoC 2014 MicroProject No.8:change multiple if-else statement to table-driven approachYao Zhao, Mar 12, 2014
  2. Eric SunshineMar 12, 2014
  3. GSoC Change multiple if-else statements to be table-drivenYao Zhao, Mar 13, 2014
  4. Eric SunshineMar 14, 2014
  5. Junio C HamanoMar 14, 2014
  6. Eric SunshineMar 17, 2014
  7. Junio C HamanoMar 17, 2014
  8. Michael HaggertyMar 17, 2014
  9. Junio C HamanoMar 17, 2014
  10. Eric SunshineMar 17, 2014
  11. Quint GuvernatorMar 17, 2014
  12. branch.c: turn nested if-else logic to table-drivenYao Zhao, Mar 16, 2014
  13. Eric SunshineMar 17, 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.