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

Re: git best strategy for two version development

From
Øystein Walle <oystwa@gmail.com>
Date
Feb 8, 2014, 12:09 UTC
Message-ID
<loom.20140208T130440-803@post.gmane.org>
In-Reply-To
<52F59131.5000808@ist.utl.pt>
Carlos Pereira <jose.carlos.pereira <at> ist.utl.pt> writes:
Show 16 quoted lines
> 
> Hello,
> 
> I am a git and CVS newbie, I bought and red most of the excellent Pro 
> Git book by Scott Chacon, but I still have a doubt. I have a package 
> that I distribute in two versions differing only in one library: 
> version_A uses this library, version_B uses my own code to replace it. 
> For strategic reasons I want to keep it this way for the time being. 
> Both versions have the same documentation, the same data files, and 99% 
> of the source code is the same (a few makefile changes, two additional 
> files in version_B and some minor changes: a diff -r has only 170 
> lines). The question is what is the best strategy to manage a situation 
> like this with git?
> 
> Shall I maintain two different repositories? I don't think so...
> 

If the changes are as small as you say, is it an option to use just one branch but have two possible build configurations? That seems like the easiest way to do it, in my opinion. E.g.:

    $ make LIB=versionA
    $ make LIB=versionB

Consider the above as pseudo-code, though. I don't know what build system you use or even if your package is even something that is "built". But you get the idea.

Øsse
Previous: Carlos Pereira
Message 4 of 4 in “git best strategy for two version development”
  1. Carlos PereiraFeb 8, 2014
  2. brian m. carlsonFeb 8, 2014
  3. Carlos PereiraFeb 8, 2014
  4. Øystein WalleFeb 8, 2014

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.