Re: [PATCH 4/7] push: introduce new push.default mode "simple"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 25, 2012, 01:53 UTC
- Message-ID
- <xmqqd36weewk.fsf@junio.mtv.corp.google.com>
- In-Reply-To
- <1335253806-9059-5-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 27 quoted lines
> diff --git a/builtin/push.c b/builtin/push.c
> index 6936713..8e663db 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -76,7 +76,43 @@ static int push_url_of_remote(struct remote *remote, const char ***url_p)
> return remote->url_nr;
> }
>
> -static void setup_push_upstream(struct remote *remote)
> +static NORETURN int die_push_simple(struct branch *branch, struct remote *remote) {
> + /*
> + * There's no point in using shorten_unambiguous_ref here,
> + * as the ambiguity would be on the remote side, not what
> + * we have locally. Plus, this is supposed to be the simple
> + * mode. If the user is doing something crazy like setting
> + * upstream to a non-branch, we should probably be showing
> + * them the big ugly fully qualified ref.
> + */
> + const char *short_upstream =
> + skip_prefix(branch->merge[0]->src, "refs/heads/");
> + if (!short_upstream)
> + short_upstream = branch->merge[0]->src;
> + /*
> + * Don't show advice for people who explicitely set
> + * push.default.
> + */
> + const char *advice_maybe = "";I've amended this to avoid decl-after-stmt.
I think the series is ready for 'next' but I'll wait for a few days or until I see acks from trusted others, whichever comes sooner.
Thanks.