Re: [RFC PATCH v3 4/4] builtin/branch: give more useful error messages when renaming

From
Kaartic Sivaraam <hidden>
Date
2017-11-03 02:41:33
Reply to
Eric Sunshine, 2017-11-02
On Thursday 02 November 2017 07:51 PM, Eric Sunshine wrote:
Nicely explained; easily understood.
Good to hear that.

Translators can correct me, but this smells like "sentence lego"[1],
which we'd like to avoid. Translators lack full context when presented
with bits and pieces of a sentence like this, thus the translation may
be of poor quality; it may even be entirely incorrect since they don't
necessarily know how you will be composing the various pieces.

You _might_ be able to able to resolve this by dropping "and" from:

     "foo is moo, and bar is boo"

to turn the error messages into independent clauses:

     "foo is moo; bar is boo"
quoted
but I'm no translator, and even that may fail the lego sniff test.
Though I can't be very sure that the one you suggested will pass the "lego sniff test", its better than the "and" I used. Further, my instinct says it wouldn't qualify as sentence lego (it's just a ";").

A sure-fire way to avoid lego construction would be simply to emit
each messages on its own line:

     fatal: branch 'tset' doesn't exist
     fatal: branch 'master' already exists

(though, you might consider that too ugly).
Though it might not look that ugly, I don't know how you could make 'git' die() twice (or am I missing something)! Of course we could use 'error()' to report the errors and then 'die()' with a message like "Branch rename failed" but I find that to be a little too verbose and further using the connector ";" instead of "and" does seem to reduce the possibilities for the above program fragment to pass the "lego sniff test".

---
Kaartic
Thread (59 messages) 59 messages, 7 authors, last reply 2018-03-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help