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

synchronizing 2 heterogenous branches by cherry-pick

From
MPMartin Pirker <git.collector@gmail.com>
Date
Jul 21, 2009, 12:42 UTC
Message-ID
<8d53e6220907210542p4c989f3av2b57202fdd2db1f5@mail.gmail.com>
One of those weird real-world situations, advice appreciated:

Given... one Git repository with one branch "left" and one branch "right" both branches have a different history (common ancestor is 0000000) both branches have different content _however_, at one specific commit in the "left" and "right" branch it can be said that the content of specific subdirectories is identical these commits are marked with a tag "equal"

Thus, patches which only modify the identical content can always be applied without conflicts on both branches. I commit a new patch on "left", I can cherry-pick it to "right" and both trees are identical again.

Issues: Cheery-pick takes only one commit. I have to find commits by hand. Ideally, I want to specify equal..HEAD, if 10 commits are "left" and "right" are 7, well, then cherry pick the last 3 from "left" to "right". Note that the patch content is always identical, the commit text message (author/committer/timestamp/...) not always Note that ideally only one way synchronizing occurs. Bonus points if I can add on both sides and then start magic sync...

Any good idea on how to automagically script these cherry-picking?
Martin
Next: Martin Pirker
Message 1 of 4 in “synchronizing 2 heterogenous branches by cherry-pick”
  1. Martin PirkerJul 21, 2009
  2. Martin PirkerJul 23, 2009
  3. Pierre HabouzitJul 23, 2009
  4. Martin PirkerJul 23, 2009

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.