git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
To: Junio C Hamano <gitster@pobox.com>,
	Christopher Tiwald <christiwald@gmail.com>
Cc: git@vger.kernel.org, peff@peff.net
Subject: Re: [PATCH] push: Provide situational hints for non-fast-forward errors
Date: Wed, 14 Mar 2012 13:14:34 +0100	[thread overview]
Message-ID: <20120314121434.GB28595@in.waw.pl> (raw)
In-Reply-To: <7vobrzst7n.fsf@alter.siamese.dyndns.org>

On Tue, Mar 13, 2012 at 09:27:08PM -0700, Junio C Hamano wrote:
> Christopher Tiwald <christiwald@gmail.com> writes:
>  * I can see there are three kinds of advices, but I do not see why users
>    need to acknowledge that they understand them one by one with separate
>    advice configuration.  Isn't it better to have only one variable, "OK,
>    I know how to deal with a failed push due to non-fast-forward"?

Hi,

I think that having three different config keys for the three
different advices makes sense, because the advices will be displayed
at different times. E.g. the user starts with the simplest one-branch
workflow, triggers the first alternative, reads "pullBeforePush" and
then disables the hint. Then the team upgrades the workflow to use
several branches and the user triggers the second alternative. At this
point, git should hint to "useUpstream". If the user disabled all the
non-FF hints at the first advice, she would miss the second, different
one, later.

> > diff --git a/Documentation/config.txt b/Documentation/config.txt
> > index c081657..50d9249 100644
> > --- a/Documentation/config.txt
> > +++ b/Documentation/config.txt
> > @@ -158,6 +158,21 @@ advice.*::
> >  		Advice shown when you used linkgit:git-checkout[1] to
> >  		move to the detach HEAD state, to instruct how to create
> >  		a local branch after the fact.
> > +	pullBeforePush::
> > +		Advice shown when you ran linkgit:git-push[1] and pushed
> > +		a non-fast-forward update to HEAD, instructing you to
> > +		linkgit:git-pull[1] before pushing again.
> > +	useUpstream::
> > +		Advice to set 'push.default' to 'upstream' when you ran
> > +		linkgit:git-push[1] and pushed 'matching refs' by default
> > +		(i.e. you did not have any explicit refspec on the command
> > +		line, and no 'push.default' configuration was set) and it
> > +		resulted in a non-fast-forward error.
> > +	checkoutPullPush::
> > +		Advice shown when you ran linkgit:git-push[1] and pushed
> > +		a non-fast-forward update to a non-HEAD branch, instructing
> > +		you to checkout the branch and run linkgit:git-pull[1]
> > +		before pushing again.
> 
> I would prefer to see these consolidated into a single advice.pushNonFF
> variable, but I may be missing why it could be a good idea to allow them
> turned off selectively.

Zbyszek

  reply	other threads:[~2012-03-14 12:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 23:22 [PATCH] push: Provide situational hints for non-fast-forward errors Christopher Tiwald
2012-03-14  4:27 ` Junio C Hamano
2012-03-14 12:14   ` Zbigniew Jędrzejewski-Szmek [this message]
2012-03-14 13:00     ` Matthieu Moy
2012-03-14 14:27       ` Zbigniew Jędrzejewski-Szmek
2012-03-14 16:40         ` Christopher Tiwald
2012-03-15  8:54         ` Clemens Buchacher
2012-03-15 18:06           ` Junio C Hamano
2012-03-16  8:19             ` Matthieu Moy
2012-03-14 14:48   ` Christopher Tiwald
2012-03-14 14:53     ` Christopher Tiwald
2012-03-14  9:06 ` Matthieu Moy
2012-03-14 15:52   ` Christopher Tiwald
2012-03-14 17:26   ` Junio C Hamano
2012-03-16  5:36     ` Junio C Hamano
2012-03-16  9:10       ` Clemens Buchacher
2012-03-16 12:03         ` Junio C Hamano
2012-03-16 17:20           ` Christopher Tiwald
2012-03-16 18:07             ` Junio C Hamano
2012-03-16 22:00               ` Junio C Hamano
2012-03-16 21:41           ` Clemens Buchacher
2012-03-16 21:53             ` Junio C Hamano
2012-03-16 22:01               ` Clemens Buchacher
2012-03-16 22:10                 ` Junio C Hamano
2012-03-17 17:10       ` [fixup PATCH] " Zbigniew Jędrzejewski-Szmek
2012-03-17 18:46         ` Christopher Tiwald
2012-03-17 19:42           ` Zbigniew Jędrzejewski-Szmek
2012-03-19  0:15           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120314121434.GB28595@in.waw.pl \
    --to=zbyszek@in.waw.pl \
    --cc=christiwald@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).