Week 4: Introducing some improvements

NEW COMMITS

I continued with the implementation of some suggestions and improvements this week. I focused on removing goto statements from builtin/bisect-helper.c file.

For those not familiar with goto in C, it is a jump statement which transfers the program’s control from one statement to another (where some label is defined). The goto statement is generally discouraged in C, because it alters the sequential flow of logic that is one characteristic of C language.

This statement is used in six functions. Keeping in mind I didn’t want to make big changes in code that were more difficult to be accepted and also increased chances of introducing bugs, my initial approach was in some cases to make simple functions with the code where goto label pointed, or in other cases replacing the call with the corresponding code.

Doing that, I found out that in some cases not all code on goto labels was needed, while in other ones there was some code redundacy. All of them were hard to spot in the goto version because the flow break I mentioned above. I think these changes will be part of a future patch series separated from the changes I am working on to move forward earlier.

These are the new six commits (one per function with a goto):

1.bisect-start()

2.bisect_append_log_quoted

3.bisect_skipped_commits()

4.bisect-write()

5.get-terms()

6.bisect-replay()

SOME RETURN CODE RESEARCH

Files related to git bisect--helper are full of return codes for different purposes that sometimes are difficult to follow when you are studying the code. Some doubts aroused me about -10 success return code introduced in this commit and I thought it was not correctly transformed to 0 return on main bisect-helper.c function.

Finally, they were some wrong or outdated comments that misleaded me. After confirming this findings with my mentor I will do some changes to improve code readability and update or remove those comments.

PATCHES FOLLOW-UP

Last week one of the accepted patches and another one waiting to be accepted were merged to master branch. Great!

To prepare the patch series, clean-up/preparatory commits were put first, and some others were splitted. Then I checked every commit compiled and passed test suite.

Next week after clarifying some issues related to -10 return code with my mentor, I would like to send the patch series.

Thank you for reading and happy New Year’s Eve!


LIST OF SENT PATCHES TO DATE

Integrated on master branch
Rejected

See also