Re: [PATCH v15 12/27] bisect--helper: `get_terms` & `bisect_terms` shell function in C
From: Pranit Bauva <hidden>
Date: 2016-12-07 12:06:29
Hey Stephan, On Wed, Dec 7, 2016 at 4:35 AM, Stephan Beyer [off-list ref] wrote:
Hey Pranit, On 12/06/2016 10:14 PM, Pranit Bauva wrote:quoted
quoted
quoted
+ + if (argc == 0) { + printf(_("Your current terms are %s for the old state\nand " + "%s for the new state.\n"), terms->term_good, + terms->term_bad);Very minor: It improves the readability if you'd split the string after the \n and put the "and "in the next line.Ah. This is because of the message. If I do the other way, then it won't match the output in one of the tests in t/t6030 thus, I am keeping it that way in order to avoid modifying the file t/t6030.I think I was unclear here. I was referring to the coding/layouting style, not to the string. I mean like writing: printf(_("Your current terms are %s for the old state\n" "and "%s for the new state.\n"), terms->term_good, terms->term_bad); The string fed to _() is the same, but it is split in a different (imho more readable) way: after the "\n", not after the "and ".
Thanks for clearing it out. This seems a sensible change.
quoted
quoted
quoted
+ die(_("invalid argument %s for 'git bisect " + "terms'.\nSupported options are: " + "--term-good|--term-old and " + "--term-bad|--term-new."), argv[i]);Hm, "return error(...)" and "die(...)" seems to be quasi-equivalent in this case. Because I am always looking from a library perspective, I'd prefer "return error(...)".I should use return error()When you reroll your patches, please also check if you always put _() around your error()s ;) (Hmmm... On the other hand, it might be arguable if translations are useful for errors that only occur when people hack git-bisect or use the bisect--helper directly... This makes me feel like all those errors should be prefixed by some "BUG: " marker since the ordinary user only sees them when there is a bug. But I don't feel in the position to decide or recommend such a thing, so it's just a thought.)
It is seems a good change, I will do it. Let other's comment on what they think in the next re-roll. Regards, Pranit Bauva