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

Re: [RFC] cherry-pick using multiple parents to implement -x

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 7, 2008, 17:28 UTC
Message-ID
<7vtzcrn9uv.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080907103415.GA3139@cuci.nl>
"Stephen R. van den Berg" <srb@cuci.nl> writes:
> The questions now are:
> - Would there be good reason not to record the backport/forwardport
>   relationship in the additional parents of a commit?

In general, I do not think what you did is a good idea. The _only_ case you can do what you did and keep your sanity is if you cherry-picked every single commit that matters from one branch to the other.

If something is not "parent", you shouldn't be recording it as such.

Remember, when you are making a commit on top of one or more parents, you are making this statement:

 * I have considered all histories leading to these parent commits, and
   based on that I decided that the tree I am recording as a child of
   these parents suits the purpose of my branch better than any of them.
This applies to one-parent case as well.

Imagine you have two histories, forked long time ago, and have side-port of one commit:

             o---...o---B---A
            /
        ---o---o---...o---X---A'

What side-porting A from the top history to create A' in the bottom history means is that the change between B and A in the top history, and no other change from the top history, is applied on top of X to produce state A' in the bottom history. What B did is not included in the bottom history.

If you recorded A' with parents A and X.  Here is what you would get:
             o---...o---B---A
            /                \ (wrong)
        ---o---o---...o---X---A'

But that is not what you did. The tree state A' lacks what B did, which could be a critical security fix, and you didn't consider all history that leads to A when you cherry-picked it to create A'.

To put it another way, having the parent link from A' to A is a statement that A' is a superset of A. Because A contains B, you are claiming A' also contains B, which is not the case in your cherry-picked history.

Previous: Stephen R. van den BergNext: Stephen R. van den Berg
Message 8 of 25 in “[RFC] cherry-pick using multiple parents to implement -x”
  1. Stephen R. van den BergSep 7, 2008
  2. Jeff KingSep 7, 2008
  3. Stephen R. van den BergSep 7, 2008
  4. Jeff KingSep 7, 2008
  5. Stephen R. van den BergSep 7, 2008
  6. Jeff KingSep 8, 2008
  7. Stephen R. van den BergSep 8, 2008
  8. Junio C HamanoSep 7, 2008
  9. Stephen R. van den BergSep 7, 2008
  10. Thomas RastSep 7, 2008
  11. Junio C HamanoSep 7, 2008
  12. Junio C HamanoSep 7, 2008
  13. Paolo BonziniSep 8, 2008
  14. Junio C HamanoSep 8, 2008
  15. Junio C HamanoSep 7, 2008
  16. Stephen R. van den BergSep 8, 2008
  17. Paolo BonziniSep 8, 2008
  18. Stephen R. van den BergSep 8, 2008
  19. Jakub NarebskiSep 8, 2008
  20. Paolo BonziniSep 8, 2008
  21. Shawn O. PearceSep 8, 2008
  22. Stephen R. van den BergSep 8, 2008
  23. Shawn O. PearceSep 8, 2008
  24. Stephen R. van den BergSep 9, 2008
  25. Paolo BonziniSep 8, 2008

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.