git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date
Mar 14, 2012, 12:14 UTC
Message-ID
<20120314121434.GB28595@in.waw.pl>
In-Reply-To
<7vobrzst7n.fsf@alter.siamese.dyndns.org>
On Tue, Mar 13, 2012 at 09:27:08PM -0700, Junio C Hamano wrote:
Show 5 quoted lines
> 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.

Show 27 quoted lines
> > 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
Previous: Junio C HamanoNext: Matthieu Moy
Message 3 of 28 in “push: Provide situational hints for non-fast-forward errors”
  1. push: Provide situational hints for non-fast-forward errorsChristopher Tiwald, Mar 13, 2012
  2. Junio C HamanoMar 14, 2012
  3. Zbigniew Jędrzejewski-SzmekMar 14, 2012
  4. Matthieu MoyMar 14, 2012
  5. Zbigniew Jędrzejewski-SzmekMar 14, 2012
  6. Christopher TiwaldMar 14, 2012
  7. Clemens BuchacherMar 15, 2012
  8. Junio C HamanoMar 15, 2012
  9. Matthieu MoyMar 16, 2012
  10. Christopher TiwaldMar 14, 2012
  11. Christopher TiwaldMar 14, 2012
  12. Matthieu MoyMar 14, 2012
  13. Christopher TiwaldMar 14, 2012
  14. Junio C HamanoMar 14, 2012
  15. Junio C HamanoMar 16, 2012
  16. Clemens BuchacherMar 16, 2012
  17. Junio C HamanoMar 16, 2012
  18. Christopher TiwaldMar 16, 2012
  19. Junio C HamanoMar 16, 2012
  20. Junio C HamanoMar 16, 2012
  21. Clemens BuchacherMar 16, 2012
  22. Junio C HamanoMar 16, 2012
  23. Clemens BuchacherMar 16, 2012
  24. Junio C HamanoMar 16, 2012
  25. push: Provide situational hints for non-fast-forward errorsZbigniew Jędrzejewski-Szmek, Mar 17, 2012
  26. Christopher TiwaldMar 17, 2012
  27. Zbigniew Jędrzejewski-SzmekMar 17, 2012
  28. Junio C HamanoMar 19, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.