Subject: Re: [fixup PATCH] push: Provide situational hints for non-fast-forward errors

From: Christopher Tiwald <[email-masked]>
Date: Sat, 17 Mar 2012 14:46:51 -0400

On Sat, Mar 17, 2012 at 06:10:35PM +0100, Zbigniew Jędrzejewski-Szmek wrote:
>  static const char message_advice_use_upstream[] =
> -	N_("Some of your local branches were stale with respect to their\n"
> -	   "remote counterparts. If you did not intend to push these branches,\n"
> -	   "you may want to set the 'push.default' configuration variable to\n"
> -	   "'current' or 'upstream' to push only the current branch.");
> +	N_("Updates were rejected because a tip of your branch is behind the remote.\n"
> +	   "If you did not intend to push that branch, you may want to explicitly\n"
> +	   "specify branches to push or set the 'push.default' configuration variable"
> +	   "to 'current' or 'upstream' to always push only the current branch.");

I prefer the "Some of your local..." language to "Updates were
rejected..." as a reader, but I think you're right about providing the
reason git rejected the push up front.

My concern about this particular message is "tip of your branch is behind
the remote" reads to me like my _current_ branch is the offender, when
that cannot be the case (it'd hit message_advice_pull_before_push
first). Maybe something like this might make it clearer?

"Updates were rejected because a pushed branch tip is behind its remote
counterpart. If you did not intend to push that branch, you may want to
explicitly specify branches to push or set the 'push.default' configuration
variable to 'current' or 'upstream' to always push only the current branch."

--
Christopher Tiwald