From: "Yohann Bénédic" <yohann.benedic@orange.com>
To: git@vger.kernel.org
Subject: Splitting a project into branches afterwards
Date: Tue, 3 May 2016 15:20:44 +0000 (UTC) [thread overview]
Message-ID: <loom.20160503T090745-628@post.gmane.org> (raw)
Hello everyone!
First of all, I believe that what I am about to ask is impossible, but I
give it a shot because there may be ways to get a close enough result or
another approach that I have not thinked of.
What I have.
A git repository cloned from svn (entire repo : 30,000 commits in 60
branches) that contains the source code of several products built around a
common framework. Branches where made to track the delivered version of each
product, so that there is a product_A_v1 branch, a product_B_v2 branch, etc.
The key point is that there is only one trunk that is common to all of the
products and framework. The source code is organized in a low-level -> high
level hierarchy which results in not having a clean top level folders for
product_A, product_B, … and framework.
What I wish I had.
A git repository with a framework branch that only contains common code, a
product_A branch that derived from the framework branch at some point,
introducing all the product_A-specific source code. Same with the other
products.
My attempt.
I started from the master branch and created a framework branch out of it. I
removed all the product specific code from it (A, B etc.) and commited
(let's call that the initial_removal commit for further reference). I then
created a product_A branch from the master branch and removed all the
product-specific code other than product A's (keeping the framework) and
commited (that's another initial_removal commit). I then did the same for
product_B, C, etc.
At this point, I am happy with the situation, even though the history
reminds me that the products were not cleanly separated from each other in
the past. The problem is with the "initial_removal" commits I made on each
branch. If the framework branch moves forward, I want my product_A branch to
be able follow along : that's a merge of the framework from product_A. In
product_A, I might fix something from the framework and need to patch the
latter. That's a merge in the other direction. Both these merges will apply
the "initial_removal" commits, generating conflics at best, silently
succeeding at worst. And that's were I am stuck because and can't find a way
to tell git to ignore them once and for all so that I can have a normal
workflow afterwards.
Further ideas.
I feel like sub-trees might help me here, but I haven't learned enough about
them to knwo for sure: anyone telling me "nope they won't help" or "yes
that's what you are looking for" would help.
Any complete procedure is welcomde too :) as weel as pointers to other git
concepts.
Thank you all for your time.
Yohann
PS. I am not a native english speaker. Please, forgive any mistake or
misleading sentence I might have written. Corrections are welcomed too!
next reply other threads:[~2016-05-04 8:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-03 15:20 Yohann Bénédic [this message]
2016-05-04 8:23 ` Splitting a project into branches afterwards Junio C Hamano
2016-05-04 8:38 ` Junio C Hamano
2016-05-04 9:52 ` yohann.benedic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20160503T090745-628@post.gmane.org \
--to=yohann.benedic@orange.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).