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

merging two equivalent branches

From
David Reitter <david.reitter@gmail.com>
Date
Jan 7, 2010, 18:17 UTC
Message-ID
<B0543B3C-C139-4BD3-B028-58B4DA132422@gmail.com>
Hello,
I have a problem with my git project, resulting from an upstream branch beyond my control being rewritten.
Can I specify parents for a revision whose history is hidden from git-log?

Concretely, I need to merge two branches that represent different conversions of the same original CVS branch (with >100k revisions). I've been working with converted branch B, but now we have a new branch A. Revisions A150 and B145 correspond to the same tree, but there is no common ancestor:

A1 -> A2 -> A3 -> .. -> A150 (A) B1 -> B2 -> B3 -> .. -> B145 (B)

I have a published downstream branch C with my own changes that started somewhere from B and has occasionally merged new developments from B.  I'd now like to switch it to A.     Future development will show up on A and I'd like to be able to merge it into C when that happens.
Using "git-merge -s ours" does this job nicely so that I can pull further development from the remote branch into mine.
However, git-log follows both parents of the new merge commit and thus shows many redundant commits.  This is OK from the logical perspective, but because I have used the "ours" merge strategy, we're guaranteed to have only one revisions in the final tree.  Thus, I wouldn't want to see all these revisions in the resulting branch.  Grafts/rewrites or git-replace would probably lead to the same issue, I reckon.
Thanks for your help.
Next: Christian MICHON
Message 1 of 6 in “merging two equivalent branches”
  1. David ReitterJan 7, 2010
  2. Christian MICHONJan 7, 2010
  3. git-log - hide parent (was: merging two equivalent branches)David Reitter, Jan 7, 2010
  4. Christian CouderJan 8, 2010
  5. David ReitterJan 12, 2010
  6. Avery PennarunJan 8, 2010

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.