Re: [RFC PATCH 1/5] builtin/checkout: avoid usage of '!!'

2017-09-23 Thread Kaartic Sivaraam
On Thursday 21 September 2017 07:01 AM, Junio C Hamano wrote: What does "with arithmetic constructs" mean? Would it refer to things like !!i != !!(j + 3) that unnecessarily obfuscates what is going on? Thanks that clears the confusion because I haven't seen constructs like this before

Re: [RFC PATCH 1/5] builtin/checkout: avoid usage of '!!'

2017-09-20 Thread Junio C Hamano
Kaartic Sivaraam writes: > Wait, I missed a contradiction here. > .. > Documentation/SubmittingPatches says: > >> - Some clever tricks, like using the !! operator with arithmetic >>constructs, can be extremely confusing to others. What does "with arithmetic constructs" mean? Would it refer

Re: [RFC PATCH 1/5] builtin/checkout: avoid usage of '!!'

2017-09-20 Thread Kaartic Sivaraam
Wait, I missed a contradiction here. On Wednesday 20 September 2017 09:30 AM, Junio C Hamano wrote:   And !!ptr is a shorter and more established way than ptr != NULL to turn non-NULL ness into an int boolean, Documentation/SubmittingPatches says:  - Some clever tricks, like using the !!

Re: [RFC PATCH 1/5] builtin/checkout: avoid usage of '!!'

2017-09-20 Thread Kaartic Sivaraam
On Wednesday 20 September 2017 09:30 AM, Junio C Hamano wrote: Kaartic Sivaraam writes: There was a usage for which there's no compelling reason.So, replace such a usage as with something else that expresses the intent more clearly. I actually think this is a good example of the exception-rul

Re: [RFC PATCH 1/5] builtin/checkout: avoid usage of '!!'

2017-09-19 Thread Junio C Hamano
Kaartic Sivaraam writes: > There was a usage for which there's no compelling reason.So, replace > such a usage as with something else that expresses the intent more > clearly. I actually think this is a good example of the exception-rule. The function wants to take true or false in "int", and t

[RFC PATCH 1/5] builtin/checkout: avoid usage of '!!'

2017-09-19 Thread Kaartic Sivaraam
Documentation/CodingGuidelines says, "Some clever tricks, like using the !! operator with arithmetic constructs, can be extremely confusing to others. Avoid them, unless there is a compelling reason to use them." There was a usage for which there's no compelling reason.So, replace