Re: [PATCH] fix an error message in git-push so it goes to stderr
- From
Jeff King <peff@peff.net>
- Date
- Feb 5, 2010, 15:06 UTC
- Message-ID
- <20100205150638.GB14116@coredump.intra.peff.net>
- In-Reply-To
- <20100205004140.GA2841@cthulhu>
On Thu, Feb 04, 2010 at 07:41:40PM -0500, Larry D'Anna wrote:
Show 19 quoted lines
> Having it go to standard output interferes with git-push --porcelain.
> ---
> builtin-push.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/builtin-push.c b/builtin-push.c
> index 5633f0a..0a27072 100644
> --- a/builtin-push.c
> +++ b/builtin-push.c
> @@ -124,9 +124,9 @@ static int push_with_options(struct transport *transport, int flags)
> return 0;
>
> if (nonfastforward && advice_push_nonfastforward) {
> - printf("To prevent you from losing history, non-fast-forward updates were rejected\n"
> - "Merge the remote changes before pushing again. See the 'Note about\n"
> - "fast-forwards' section of 'git push --help' for details.\n");
> + fprintf(stderr, "To prevent you from losing history, non-fast-forward updates were rejected\n"
> + "Merge the remote changes before pushing again. See the 'Note about\n"
> + "fast-forwards' section of 'git push --help' for details.\n");I agree that stderr is a more sensible place for such a message to go, but shouldn't the porcelain output format just suppress it entirely? The whole point of it is to be machine readable, and this text is
a. formatted for humans
b. totally redundant with the machine-readable information presented
earlier-Peff