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

Re: [PATCH] git-status: Show empty directories

From
Kkonglu@minatec.inpg.fr <konglu@minatec.inpg.fr>
Date
Jun 9, 2012, 21:47 UTC
Message-ID
<20120609234717.Horde.I9rYUXwdC4BP08RlFRO2w_A@webmail.minatec.grenoble-inp.fr>
In-Reply-To
<877gvgrxw7.fsf@thomas.inf.ethz.ch>
Thomas Rast <trast@student.ethz.ch> a écrit :
Show 20 quoted lines
> Leila <muhtasib@gmail.com> writes:
>
>>> The structure is
>>>      if (...) {
>>>             /*code*/
>>>      } else {
>>>             /*code*/
>>>      }
>>>
>>> Do not forget braces in the "else" part as the firt block needs it.
>>
>> I was under the impression that one liners didn't require parenthesis
>> according to the style guidelines. I didn't realize that if the 'if'
>> required it, then the else required it. I will make that change and
>> remember it for the future. Thanks!
>
> It's not required, there's plenty of precedent, even one case within
> wt-status.c, of '} else'.  Try running
>
>   git grep '} else$'

It's not because "there's plenty of precedent" that we should not try to improve the format of the code. That's why there're coding style rules so that we can keep the improvements consistent.

Thanks.
Lucien Kong
Previous: LeilaNext: Thomas Rast
Message 6 of 17 in “git-status: Show empty directories”
  1. git-status: Show empty directoriesLeila Muhtasib, Jun 9, 2012
  2. konglu@minatec.inpg.frJun 9, 2012
  3. LeilaJun 9, 2012
  4. Thomas RastJun 9, 2012
  5. LeilaJun 9, 2012
  6. konglu@minatec.inpg.frJun 9, 2012
  7. Thomas RastJun 10, 2012
  8. konglu@minatec.inpg.frJun 10, 2012
  9. LeilaJun 10, 2012
  10. Junio C HamanoJun 11, 2012
  11. Junio C HamanoJun 10, 2012
  12. LeilaJun 10, 2012
  13. konglu@minatec.inpg.frJun 10, 2012
  14. LeilaJun 10, 2012
  15. Junio C HamanoJun 11, 2012
  16. LeilaJun 11, 2012
  17. LeilaJun 11, 2012

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.