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

Re: first parent, commit graph layout, and pull merge direction

From
Junio C Hamano <gitster@pobox.com>
Date
May 24, 2013, 19:23 UTC
Message-ID
<7vmwrk89mb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130524171110.GB9448@inner.h.apk.li>
Andreas Krey <a.krey@gmx.de> writes:
Show 24 quoted lines
> On Thu, 23 May 2013 09:01:15 +0000, Junio C Hamano wrote:
> ...
>> Instead of having a nice "these six commits marked as 'x' were done
>> on a branch forked some time ago, to address only this one issue and
>> to address it fully" history that explains how these commits were
>> related and these commits are the full solution to a single issue:
>> 
>>       x---x---x---x---x---x
>>      /                     \
>>  ---o---o---o---o---o---o---M---o---o---...
>> 
>> they end up with something like this, even with the "flip the heads
>> of a merge" option, by pulling too often:
>> 
>>       x---x   x---x---x   x
>>      /     \ /         \ / \
>>  ---o---o---M---o---o---M---M---o---o---...
>
> Wouldn't that be (you don't want to put your work back into master before
> it's done) the following?
>
>        x---x---M---x---x---M--x
>       /       /           /    \
>   ---o---o---M---o---o---M--o---M---o---o---...

That is what you would get if you "pull from my upstream" with the current software.

And that is what triggered this discussion thread in which some people said that they do not want that shape of the history.

At the leftmost merge M you drew on the upper line (i.e. your topic), the merge pulls in other's commits that are unrelated to each other as if it were a meaningful group of commits on a side branch. They want to see the merge going other way around, pulling your work done on a side branch, integrating into the mainline.

The second illustration you are commenting on were done to explain why such a "when pulling from my upstream, I want the order of parents swapped, so that mainline appears as the first parent" is not solving the whole issue. The time series would go more like this:

(1) While you were working on two 'x's, others have worked to
    advance the mainline:
       x---x  Your 'master'
      /
  ---o---o  Mainline
(2) You cannot push without losing others work, so you pull, but in
    order to avoid the "others work on mixed on a single side
    branch" issue, you use the fictional "flip heads of a merge"
    option, and push the result out.  That becomes the tip of the
    mainline:
       x---x
      /     \
  ---o---o---M
(3) Then you keep working to build more commits on top. 
       x---x   x---x---x
      /     \ /
  ---o---o---M
(4) And others also keep working.
       x---x   x---x---x
      /     \ /
  ---o---o---M---o---o
Previous: Andreas KreyNext: Andreas Krey
Message 62 of 69 in “first parent, commit graph layout, and pull merge direction”
  1. Andreas KreyMay 22, 2013
  2. Junio C HamanoMay 22, 2013
  3. Andreas KreyMay 23, 2013
  4. John SzakmeisterMay 23, 2013
  5. Jeremy RosenMay 23, 2013
  6. Andreas KreyMay 23, 2013
  7. John KeepingMay 23, 2013
  8. Junio C HamanoMay 23, 2013
  9. John KeepingMay 23, 2013
  10. Junio C HamanoMay 23, 2013
  11. John KeepingMay 23, 2013
  12. Felipe ContrerasMay 23, 2013
  13. Junio C HamanoMay 23, 2013
  14. Felipe ContrerasMay 23, 2013
  15. Junio C HamanoMay 23, 2013
  16. Felipe ContrerasMay 23, 2013
  17. Junio C HamanoMay 23, 2013
  18. Felipe ContrerasMay 23, 2013
  19. John KeepingMay 24, 2013
  20. John SzakmeisterMay 24, 2013
  21. Linus TorvaldsMay 24, 2013
  22. Junio C HamanoMay 24, 2013
  23. Linus TorvaldsMay 24, 2013
  24. Felipe ContrerasMay 24, 2013
  25. Felipe ContrerasMay 24, 2013
  26. Junio C HamanoMay 24, 2013
  27. Philip OakleyMay 24, 2013
  28. pull: require choice between rebase/merge on non-fast-forward pullJunio C Hamano, Jun 27, 2013
  29. W. Trevor KingJun 27, 2013
  30. Junio C HamanoJun 27, 2013
  31. W. Trevor KingJun 28, 2013
  32. Matthieu MoyJun 28, 2013
  33. W. Trevor KingJun 28, 2013
  34. Matthieu MoyJun 28, 2013
  35. W. Trevor KingJun 28, 2013
  36. Fredrik GustafssonJun 27, 2013
  37. Junio C HamanoJun 27, 2013
  38. W. Trevor KingJun 27, 2013
  39. Junio C HamanoJun 27, 2013
  40. Matthieu MoyJun 27, 2013
  41. W. Trevor KingJun 28, 2013
  42. John KeepingJun 28, 2013
  43. Junio C HamanoJun 28, 2013
  44. John KeepingJun 28, 2013
  45. Junio C HamanoJun 28, 2013
  46. John KeepingJul 2, 2013
  47. fixup! pull: require choice between rebase/merge on non-fast-forward pullJohn Keeping, Jul 14, 2013
  48. Junio C HamanoJul 15, 2013
  49. Felipe ContrerasAug 28, 2013
  50. John KeepingJul 18, 2013
  51. Andreas SchwabJul 18, 2013
  52. Junio C HamanoJul 18, 2013
  53. pull: require choice between rebase/merge on non-fast-forward pullJunio C Hamano, Jul 18, 2013
  54. Eric SunshineJul 19, 2013
  55. Junio C HamanoJul 19, 2013
  56. Eric SunshineJul 19, 2013
  57. Junio C HamanoJul 19, 2013
  58. Eric SunshineJul 19, 2013
  59. Junio C HamanoJul 19, 2013
  60. FlimmJan 22, 2014
  61. Andreas KreyMay 24, 2013
  62. Junio C HamanoMay 24, 2013
  63. Andreas KreyMay 23, 2013
  64. Holger Hellmuth (IKS)May 24, 2013
  65. Andreas KreyMay 24, 2013
  66. Holger Hellmuth (IKS)May 24, 2013
  67. Andreas KreyMay 24, 2013
  68. Felipe ContrerasMay 23, 2013
  69. Andreas KreyMay 23, 2013

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.