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
Junio C Hamano <gitster@pobox.com>
Date
Mar 16, 2012, 18:07 UTC
Message-ID
<7vk42kh11k.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120316172013.GA8119@gmail.com>
Christopher Tiwald <christiwald@gmail.com> writes:
Show 6 quoted lines
> One quick, slightly-off-topic question: I'd like to take another crack
> at the patch's commit message, to implement some of your language
> suggestions and clean it up further. Is it reasonable for me to wait a
> few days for additional comments or updates, squash together these
> fixups into a single v2 patch (assuming one patch is a logical unit for
> it), then resubmit?
Surely.

After reading the fix-up patch again, I actually have a couple of comments/reservations myself.

 (1) I suggested (and the fix-up patch does so) to use a single existing
     advice configuration, but if you read the description in my response
     to Clemens carefully, you may realize that at least the configuration
     for "Here is how to deal with your current branch" and "Here is how
     for the rest of your branch" might be better if they are separate
     variables. The user may fix current branch (i.e. "pull then push"),
     set the advice.pushNonFastForward to false thinking that he learned
     everything there to know about non fast-forward, and then get another
     failure from "git push" because other branches are still behind, but
     with my "fix-up" patch, we would no longer give advice to him.
 (2) The advice to "Your current branch is OK but you are also pushing
     others that do not fast-forward" only talks about "check out, pull
     and then push", but an equally plausible solution may be "don't push
     other branches---you are not working on them right now".  Both of our
     versions have this issue.
     I didn't trace the logic flow, though. If this advice is issued only
     to the user who explicitly said he wants to push these other branches
     (e.g. has "push.default = matching" in the config and gave no command
     line options, or gave refspec on the command line to tell us to push
     these other branches), then the wording is OK.
     But for the purpose of helping people who may be surprised by the
     current "matching" default, I think we should detect this very narrow
     case:
     - The user did not give us any refspec from the command line; and
     - The user does not have push.default set to matching (either the
       user does not have any push.default, or it is set to something
       else); and
     - The remote.$name.push would not push the branch other than the
       current branch.
     When these three conditions hold, we can be sure that the user worked
     on more than one branch and did "git push $there" without telling us
     what to push, and we defaulted to push "matching" and failed on stale
     branches that the user hasn't been working on.  In that case, "don't
     push other branches---perhaps push.default needs to be set" may be a
     far more appropriate advice.
     So, the third case may have to be split further into two.
Previous: Christopher TiwaldNext: Junio C Hamano
Message 19 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.