<div dir="ltr">+1 to existing Linux kernel style. Moreover, its a style which is used heavily in existing code base. I don't see any advantage in changing the style now.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 13, 2014 at 9:12 PM, Kaleb S. KEITHLEY <span dir="ltr"><<a href="mailto:kkeithle@redhat.com" target="_blank">kkeithle@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><top post><br>
<br>
ISTR we agreed to use Linux kernel style!<br>
<br>
Which is<br>
<br>
if (foo) {<br>
/* ... */<br>
} else {<br>
/* ... */<br>
}<br>
<br>
I don't recall any discussion on -devel about changing this.<br>
<br>
</top post><div class="HOEnZb"><div class="h5"><br>
<br>
On 10/13/2014 11:05 AM, Pranith Kumar Karampuri wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 10/13/2014 07:43 PM, Shyam wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 10/13/2014 10:08 AM, Pranith Kumar Karampuri wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 10/13/2014 07:27 PM, Shyam wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 10/13/2014 08:01 AM, Pranith Kumar Karampuri wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hi,<br>
Why are we moving away from this coding style?:<br>
if (x) {<br>
/*code*/<br>
} else {<br>
/* code */<br>
}<br>
</blockquote>
<br>
This patch (in master) introduces the same and explains why,<br>
<br>
commit 0a8371bdfdd88e662d09def717cc0b<u></u>822feb64e8<br>
Author: Jeff Darcy <<a href="mailto:jdarcy@redhat.com" target="_blank">jdarcy@redhat.com</a>><br>
Date: Mon Sep 29 17:27:14 2014 -0400<br>
<br>
extras: reverse test for '}' vs. following 'else' placement<br>
<br>
The two-line form "}\nelse {" has been more common than the<br>
one-line<br>
form "} else {" in our code for years, and IMO for good reason (see<br>
the comment in the diff).<br>
</blockquote>
Will there be any objections to allow the previous way of writing this<br>
if/else block? I just don't want to get any errors in 'check-formatting'<br>
when I write the old way for this.<br>
May be we can change it to warning?<br>
</blockquote>
<br>
I am going to state my experience/expectation :)<br>
<br>
I actually got this _error_ when submitting a patch, and thought to<br>
myself "isn't the one-line form the right one?" then went to see why<br>
this check was in place and read the above. Going by the reason in the<br>
patch, I just adapted myself.<br>
<br>
Now, coming to _allowing_ both forms with a warning, my personal call<br>
is _no_, we should allow one form so that the code is readable and<br>
there is little to no confusion for others on which form to use. So I<br>
would say no to your proposal.<br>
</blockquote>
Hmm... okay (It is still not an emphatic yes). But it is a waste of time<br>
to talk more about this.<br>
<br>
Jeff/Vijay,<br>
I urge you guys to notify others before making basic style<br>
changes like this.<br>
<br>
Pranith<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Shyam<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="http://supercolony.gluster.org/mailman/listinfo/gluster-devel" target="_blank">http://supercolony.gluster.<u></u>org/mailman/listinfo/gluster-<u></u>devel</a><br>
</blockquote>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
<br>
Kaleb</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="http://supercolony.gluster.org/mailman/listinfo/gluster-devel" target="_blank">http://supercolony.gluster.<u></u>org/mailman/listinfo/gluster-<u></u>devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Raghavendra G<br>
</div>