subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Feldhacker, Chris" <>
Subject RE: Understanding merging
Date Tue, 08 Mar 2011 22:27:28 GMT
-----Original Message-----
From: Steve Cohen [] 
Sent: Tuesday, March 08, 2011 12:20 PM
Subject: Understanding merging

> I work with a very senior colleague who has never always resisted version control and
would much rather do without it, but he is forced to go along and I am the whipping boy whenever
something goes wrong.
> He poses a general but simple question that I find myself unable to give a simple answer
to.  I am rephrasing it slightly but it bothers me that I don't know the simple answer.  If
I found myself in this situation I would tweak until it was as desired, but my persnickety
colleague is not satisfied with such answers and for once, I don't blame him.
> Given two branches off a trunk that were taken at different times, if the first is merged
back to the trunk and then the second, how may the second be merged back into the trunk so
as not to override changes from the first merge, assuming that both change sets are desired
to be in the trunk at the end?

Do the branches receive updates from trunk or not?
If the answer is yes, then before merging a branch back to trunk, one final update from trunk
to the branch must be performed.  The branch is now up-to-date with trunk, and (ideally) the
changes on the branch should be retested to make sure everything works.  When ready, the branch
is merged using the "reintegrate" option back to the trunk.  Using "reintegrate", the differences
between the branch and the trunk are computed and the changes applied to the trunk.

If the answer is no, then when the changes on the branch are ready to be merged back to the
trunk the "reintegrate" option must NOT be used.  Without "reintegrate", the changes made
on the branch are collected and effectively "replayed" on the trunk, which will have the desired
result regardless of whether or not additional changes to trunk have already been made.

So, a specific decision must be made as to whether or not "reintegrate" should be used, and
the correct answer depends on whether or not the branch receives updates from trunk during
its life.  

As long as the correct choice is made each time a branch is merged, then no changes will be
undone or "overridden".

(It would be really nice if Subversion could detect that a branch has received updates from
the origin and follow the best practice of "do the right thing by default", is what
it is!)

-----Message Disclaimer-----

This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.

While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.

View raw message