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

Re: Splitting a project into branches afterwards

From
Junio C Hamano <gitster@pobox.com>
Date
May 4, 2016, 08:38 UTC
Message-ID
<xmqqk2jai5fb.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqoa8mi64h.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> Yohann Bénédic <yohann.benedic@orange.com> writes:
>
>> 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.
>
> Instead of doing a mixed ball of wax on product specific branch,
> can't you do the latter by (1) fix something that belongs to the
> framework part of the system on the framework branch, (2) merge that
> to product A branch, and then (3) use that fixed framework code to
> update the product A?  That way you would never have to merge
> product specific part to the framework, which is meant to be product
> agnistic (which is the whole point of your "initial removal" done on
> the framework branch, if I am reading you correctly).
In addition, I would imagine that you have this:
      F+B
     /
 ---X---F
     \
      F+A

where F stands for "framework part", A stands for "product A" and X is F+A+B (i.e. everything). The first thing I would do if that is what you have is to abandon the product specific branches directly forked from the "everything" and instead form a history of this shape:

          F+B
         /
 ---X---F
         \
          F+A

That is, make the commit marked F in the updated history, whose tree has only the framework part, the new "birth" of your company's source code, where other product specific branches all fork off of.

Then touch the common framework only on its own branch, occasionally merging that down to (all) product specific branches, change product specific parts only on their own product specific branch, and merge only in one direction (i.e. framework to product), never in reverse.

          F+B
         /
 ---X---F-----F'-----F''   ... framework evolves this way
         \            \    
          F+A---F+A'---F''+A'  ... product A evolves this way
Previous: Junio C HamanoNext: yohann.benedic@orange.com
Message 3 of 4 in “Splitting a project into branches afterwards”
  1. Yohann BénédicMay 3, 2016
  2. Junio C HamanoMay 4, 2016
  3. Junio C HamanoMay 4, 2016
  4. yohann.benedic@orange.comMay 4, 2016

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.