Re: [PATCH 1/4] status: factor two rebase-related messages together
From: Guillaume Pages <hidden>
Date: 2016-06-15 23:05:13
"Junio C Hamano" [off-list ref] writes:
Hmmm, it obviously does not break anything but it is not obvious why this is a good change.
Is it that you wanted to have a single instance of "if on a branch, we say 'you are rebasing that branch', otherwise we say 'you are rebasing'"? Even then, I am not sure if this code movement was the best way to do so (an obvious alternative is to use a shared helper function and call from the two arms of if/elseif/... chain).
I made this change because at first sight, this piece of code was difficult to read for me. There was two long branches very similar and I had to spot the differences, and the actual differences were at the very end of the branches so I had to check back what the condition was about. It seems now much more natural to me: the part in common of both branches is in OR-condition and the differences between branches are gathered with the test on the variable they depend. By the way, I agree that this change is not absolutely necessary.