diff mbox series

[v5,02/13] bisect--helper: use '-res' in 'cmd_bisect__helper' return

Message ID 20200717105406.82226-3-mirucam@gmail.com (mailing list archive)
State New, archived
Headers show
Series Finish converting git bisect to C part 2 | expand

Commit Message

Miriam R. July 17, 2020, 10:53 a.m. UTC
Following 'enum bisect_error' vocabulary, return variable 'res' is
always non-positive.
Let's use '-res' instead of 'abs(res)' to make the code clearer.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Miriam Rubio <mirucam@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/bisect--helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shourya Shukla July 25, 2020, 5:31 p.m. UTC | #1
> Following 'enum bisect_error' vocabulary, return variable 'res' is
> always non-positive.
> Let's use '-res' instead of 'abs(res)' to make the code clearer.

> Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> Signed-off-by: Miriam Rubio <mirucam@gmail.com>
> Helped-by: Junio C Hamano <gitster@pobox.com>

Although there is no set rule for this, but I think that your sign-off
goes at the last generally. This is what I have seen on various patches.
Junio C Hamano July 25, 2020, 11:03 p.m. UTC | #2
Shourya Shukla <shouryashukla.oo@gmail.com> writes:

>> Following 'enum bisect_error' vocabulary, return variable 'res' is
>> always non-positive.
>> Let's use '-res' instead of 'abs(res)' to make the code clearer.
>
>> Mentored-by: Christian Couder <chriscool@tuxfamily.org>
>> Signed-off-by: Miriam Rubio <mirucam@gmail.com>
>> Helped-by: Junio C Hamano <gitster@pobox.com>
>
> Although there is no set rule for this, but I think that your sign-off
> goes at the last generally. This is what I have seen on various patches.

It is most natural to list these entries in chronological order.

Code was written while others helped, and the final seal on what
gets sent out is stamped by appending the author's sign-off at the
end.

Thanks.
Pratyush Yadav July 27, 2020, 5:42 a.m. UTC | #3
On 25/07/20 11:01PM, Shourya Shukla wrote:
> > Following 'enum bisect_error' vocabulary, return variable 'res' is
> > always non-positive.
> > Let's use '-res' instead of 'abs(res)' to make the code clearer.
> 
> > Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> > Signed-off-by: Miriam Rubio <mirucam@gmail.com>
> > Helped-by: Junio C Hamano <gitster@pobox.com>
> 
> Although there is no set rule for this, but I think that your sign-off
> goes at the last generally. This is what I have seen on various patches.

The rule of thumb I follow is to have these in chronological order. So 
Christian first mentored, then the patch was published so Junio helped 
next and finally you sign off the patch before sending it out so that 
comes last.
Pratyush Yadav July 27, 2020, 6:46 a.m. UTC | #4
On 27/07/20 11:12AM, Pratyush Yadav wrote:
> On 25/07/20 11:01PM, Shourya Shukla wrote:
> > > Following 'enum bisect_error' vocabulary, return variable 'res' is
> > > always non-positive.
> > > Let's use '-res' instead of 'abs(res)' to make the code clearer.
> > 
> > > Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> > > Signed-off-by: Miriam Rubio <mirucam@gmail.com>
> > > Helped-by: Junio C Hamano <gitster@pobox.com>
> > 
> > Although there is no set rule for this, but I think that your sign-off
> > goes at the last generally. This is what I have seen on various patches.
> 
> The rule of thumb I follow is to have these in chronological order. So 
> Christian first mentored, then the patch was published so Junio helped 
> next and finally you sign off the patch before sending it out so that 
> comes last.

My MUA didn't download Junio's reply earlier for some reason. Sorry for 
the redundant message.
Junio C Hamano July 27, 2020, 4:21 p.m. UTC | #5
Pratyush Yadav <me@yadavpratyush.com> writes:

> My MUA didn't download Junio's reply earlier for some reason. Sorry for 
> the redundant message.

Mails cross all the time---you do not have to apologize.
diff mbox series

Patch

diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index c452d3f6b7..0466b07a43 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -727,5 +727,5 @@  int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
 	if (res == BISECT_INTERNAL_SUCCESS_MERGE_BASE)
 		res = BISECT_OK;
 
-	return abs(res);
+	return -res;
 }