Re: [PATCH 2/6] reflog: remove i18n legos in pruning message
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- May 31, 2012, 13:45 UTC
- Message-ID
- <20120531134538.GA10523@burratino>
- In-Reply-To
- <1338469482-30936-3-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy wrote:
Show 14 quoted lines
> --- 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.)