Re: [PATCH 2/6] reflog: remove i18n legos in pruning message
From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:53:57
Nguyễn Thái Ngọc Duy wrote:
quoted hunk ↗ jump to hunk
--- a/builtin/reflog.c +++ b/builtin/reflog.c@@ -330,8 +330,12 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1, printf("keep %s", message); return 0; prune: - if (!cb->newlog || cb->cmd->verbose) - printf("%sprune %s", cb->newlog ? "" : "would ", message); + if (!cb->newlog || cb->cmd->verbose) { + if (cb->newlog) + printf("prune %s", message); + else + printf("would prune %s", message); + }
Thanks. Style: how about
if (!cb->newlog)
printf("would prune %s", message);
else if (cb->cmd->verbose)
printf("prune %s", message);
? I think that would be more readable than the lego original.
BTW I'm not sure if this message would be a good candidate for
translation. Especially in the --dry-run case, it feels like output
that is intended to be simple enough for scripts to parse. (Though on
the other hand, I don't know of any scripts or use cases that actually
parse it, so maybe nobody would mind.)