Re: [PATCH] branch.c: simplify chain of if statements
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Mar 17, 2014, 12:53 UTC
- Message-ID
- <CACBZZX6P38BEQ15w1nVh9cM6nMj0dq-HtT1ZJFfZadriXjZReA@mail.gmail.com>
- In-Reply-To
- <loom.20140317T120153-546@post.gmane.org>
On Mon, Mar 17, 2014 at 12:46 PM, Dragos Foianu <dragos.foianu@gmail.com> wrote:
Show 5 quoted lines
> The reason I did not go with this is because I would still need the four ifs > in order to keep the bug check part of the code. I might be able to find a > work-around for it on the second attempt. > > I have seen N_() used in other code but I wasn't sure what its purpose was.
Aside from other comments here, more generally if you see code that looks odd it helps to see why it was introduced initially.
In this case if you'd ran e.g.:
git log --reverse -p -G'Branch %s set up to track remote branch %s from %s by rebasing' -- branch.c
or otherwise searched for the first occurrence of that odd-looking code you'd have gotten:
commit d53a3503
Author: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date: Thu Jun 7 19:05:10 2012 +0700Remove i18n legos in notifying new branch tracking setup
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>And searching for that commit has plenty of context for why that was done: https://www.google.com/search?q=%22Remove%20i18n%20legos%20in%20notifying%20new%20branch%20tracking%20setup%22