git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Advice/help needed
@ 2009-11-16 16:27 Ian Hobson
  2009-11-16 16:40 ` Yann Simon
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Hobson @ 2009-11-16 16:27 UTC (permalink / raw)
  To: git

Hi all,

I am trying to switch to GIT (from SVN), and have become sorely 
confused. I am not sure of the best way to solve the problem I have, 
(nor how to actually implement a solution when one is chosen).

I am building a web application in php. There are  2 (soon to be four) 
versions each slightly different for different customers. Each needs 
testing when installed in "/" and "/dir" on the web site.

So far I have one system that in installed in a git repo on a Linux VM 
with a share. This way I can develop in windows where I am familiar, 
serve the files under linux (to match the production environment) and 
run unit tests using phpUnit. The test files are all in a sub-directory 
of the main directory. The application is served from a directory in the 
website, so I could have different directories for different purposes, 
but I have not had to use this yet.

Before release, I fetch and merge the files into a second installation 
under windows, where I can serve it from the root. This forms a second 
level of test. I release by copying the files with FTP (so that test 
files and the GIT repo don't go on the production server).

This arrangement only works because I have been able to set up the 
configuration files, database users and similar so they are all the same 
on each installation. With 4 similar versions this will no longer be 
possible.

What I want to be able to do is control all 4 versions in the same 
manner, keep all file - common, different and test - in git, and have 
checkout worry about changing versions.

My thoughts are to have 4 branches, one for each customer. 99% of all 
changes will be needed by all (or at least most)
of the customers (P,W,S and E). How can I make a change to master and 
then use git to apply those changes to the four branches, without losing 
the differences between branches?

For example (if this is the best way) go from this
O-----O-----A-----B-----C  (master)
  \----P
   \---W
    \--S
     \-E

to first this, where D is the net effect of A B and C  (this is for ease 
of reading logs, and commit messages),
O-----O-----D  (head) 
  \----P
   \---W
    \--S
     \-E

and then to this, (without editing all the files four times?)
O-----O-----D  (head)
  \----P-----D'
   \---W----D''
    \--S-----D'''
     \-E-----D''''

Or would I be better having 4 repositories, one for each customer? Then 
I need to pull changes and cherry pick the changes I want for each 
customer?

I am the only developer, so the processes need to be simple so I am not 
faced with sorting out my own errors! :)

Regards

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Advice/help needed
  2009-11-16 16:27 Advice/help needed Ian Hobson
@ 2009-11-16 16:40 ` Yann Simon
  2009-11-16 22:46   ` Ian Hobson
  0 siblings, 1 reply; 3+ messages in thread
From: Yann Simon @ 2009-11-16 16:40 UTC (permalink / raw)
  To: Ian Hobson; +Cc: git

2009/11/16 Ian Hobson <ian@ianhobson.co.uk>:
> My thoughts are to have 4 branches, one for each customer. 99% of all
> changes will be needed by all (or at least most)
> of the customers (P,W,S and E). How can I make a change to master and then
> use git to apply those changes to the four branches, without losing the
> differences between branches?
>
> For example (if this is the best way) go from this
> O-----O-----A-----B-----C  (master)
>  \----P
>  \---W
>   \--S
>    \-E
>
> to first this, where D is the net effect of A B and C  (this is for ease of
> reading logs, and commit messages),
> O-----O-----D  (head)  \----P
>  \---W
>   \--S
>    \-E
>
> and then to this, (without editing all the files four times?)
> O-----O-----D  (head)
>  \----P-----D'
>  \---W----D''
>   \--S-----D'''
>    \-E-----D''''

What I would do is:
- one branch for the common
- one branch for each customer, which contains the specific
differences compare to the common branch

You could program on the common branch.
When you are ready, you can checkout each specific branch and rebase
on the common branch.
For example:
$ git checkout common
edit, test, commit
$ git checkout client1
$ git rebase common
$ git checkout client2
$ git rebase common

Another solution is to have a branch for each customer, to commit on
one branch, and to cherry-pick this last commit on all the other
branches.

Yann

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Advice/help needed
  2009-11-16 16:40 ` Yann Simon
@ 2009-11-16 22:46   ` Ian Hobson
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Hobson @ 2009-11-16 22:46 UTC (permalink / raw)
  To: Yann Simon; +Cc: git

Yann Simon wrote:
> 2009/11/16 Ian Hobson <ian@ianhobson.co.uk>:
>   
>> My thoughts are to have 4 branches, one for each customer. 99% of all
>> changes will be needed by all (or at least most)
>> of the customers (P,W,S and E). How can I make a change to master and then
>> use git to apply those changes to the four branches, without losing the
>> differences between branches?
>>
>> For example (if this is the best way) go from this
>> O-----O-----A-----B-----C  (master)
>>  \----P
>>  \---W
>>   \--S
>>    \-E
>>
>> to first this, where D is the net effect of A B and C  (this is for ease of
>> reading logs, and commit messages),
>> O-----O-----D  (head)  \----P
>>  \---W
>>   \--S
>>    \-E
>>
>> and then to this, (without editing all the files four times?)
>> O-----O-----D  (head)
>>  \----P-----D'
>>  \---W----D''
>>   \--S-----D'''
>>    \-E-----D''''
>>     
>
> What I would do is:
> - one branch for the common
> - one branch for each customer, which contains the specific
> differences compare to the common branch
>
> You could program on the common branch.
> When you are ready, you can checkout each specific branch and rebase
> on the common branch.
> For example:
> $ git checkout common
> edit, test, commit
> $ git checkout client1
> $ git rebase common
> $ git checkout client2
> $ git rebase common
>
>   
Hi Yann,

I'll use master for common, unless I have a large chunk of development 
to do, and see how it goes.

Many thanks.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-16 22:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-16 16:27 Advice/help needed Ian Hobson
2009-11-16 16:40 ` Yann Simon
2009-11-16 22:46   ` Ian Hobson

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).