Re: [PATCH 1/4] status: factor two rebase-related messages together
- From
- Guillaume Pages <guillaume.pages@ensimag.grenoble-inp.fr>
- Date
- Jun 9, 2015, 07:33 UTC
- Message-ID
- <968122035.288953.1433835215140.JavaMail.zimbra@ensimag.grenoble-inp.fr>
- In-Reply-To
- <xmqqbngp97yp.fsf@gitster.dls.corp.google.com>
"Junio C Hamano" <gitster@pobox.com> writes:
>Hmmm, it obviously does not break anything but it is not obvious why >this is a good change.
Show 5 quoted lines
>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.