-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbranching-and-merging.html
197 lines (180 loc) · 9.92 KB
/
branching-and-merging.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html lang="en">
<head>
<title>Branching and Merging | Undefined Value</title>
<meta charset="utf-8" />
<link href="https://undefinedvalue.com/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Undefined Value Full Atom Feed" />
<link href="https://undefinedvalue.com/atom.xml" type="application/atom+xml" rel="alternate" title="Undefined Value Atom Feed" />
<link href="https://undefinedvalue.com/rss.xml" type="application/rss+xml" rel="alternate" title="Undefined Value RSS Feed" />
<link href="https://undefinedvalue.com/feeds/{slug}.atom.xml" type="application/atom+xml" rel="alternate" title="Undefined Value Categories Atom Feed" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="//fonts.googleapis.com/css?family=Oswald%7CLato%7CInconsolata" rel="stylesheet">
<link rel="stylesheet" href="https://undefinedvalue.com/theme/css/normalize.css" />
<link rel="stylesheet" href="https://undefinedvalue.com/theme/css/skeleton.css" />
<link rel="stylesheet" href="https://undefinedvalue.com/theme/css/highlight.css" />
<link rel="stylesheet" href="https://undefinedvalue.com/theme/css/style.css" />
<link rel="icon" type="image/png" href="images/favicon.png" />
<meta name="tags" content="versioncontrol" />
<meta name="tags" content="programming" />
<meta name="tags" content="sourcesafe" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-43697246-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body id="index" class="home">
<div class="container">
<div class="row">
<div class="logo">
<a href="https://undefinedvalue.com/">
<img src="https://undefinedvalue.com/theme/images/undefinedvalue_logo.png" alt="Logo">
</a>
</div><!-- /.logo -->
<header id="banner" class="body">
<h1><a href="https://undefinedvalue.com/">Undefined Value</a></h1>
<strong>Kris Johnson's Blog</strong>
</header><!-- /#banner -->
</div><!-- /.row -->
<div class="row">
<nav id="menu"><ul>
<li><a href="/">Front Page</a></li>
<li><a href="/tags.html">Tags</a></li>
<li><a href="/archives.html">Archives</a></li>
<li><a href="https://undefinedvalue.com/pages/about-me.html">About Me</a></li>
<li><a href="https://undefinedvalue.com/pages/kjresume.html">My Résumé</a></li>
<li><a href="https://undefinedvalue.com/search.html">Search</a></li>
</ul></nav><!-- /#menu -->
</div><!-- /.row -->
<div class="row">
<div class="nine columns">
<section id="content" class="body">
<header>
<h2 class="entry-title">
<a href="https://undefinedvalue.com/branching-and-merging.html" rel="bookmark"
title="Permalink to Branching and Merging">Branching and Merging</a></h2>
</header>
<footer class="post-info">
<time class="published" datetime="2004-02-28T16:45:00-05:00">
2004-02-28
</time>
<ul class="tags">
<li><a class="tag" href="https://undefinedvalue.com/tag/versioncontrol.html">versioncontrol</a></li>
<li><a class="tag" href="https://undefinedvalue.com/tag/programming.html">programming</a></li>
<li><a class="tag" href="https://undefinedvalue.com/tag/sourcesafe.html">sourcesafe</a></li>
</ul>
</footer><!-- /.post-info -->
<div class="entry-content">
<p>A few months ago, we started developing a new product that was a major
extension of an existing product. While we may have been able to keep
one codeline that supported both the old product and the new product,
many factors led us to decide to branch the codeline. I have continued
to maintain the old codeline for existing deployments, while I and a
group of others have worked on the new codeline.</p>
<p>In the new codeline, we have tried to correct many of our past sins. The
original product was developed under a tight deadline with vague
requirements and insufficient testing, and the codeline reflects that.
The new codeline has some significant architectural changes in addition
to having the new features.</p>
<p>I have been trying to keep things in sync between old and new. When we
find and fix a bug in one codeline, or when a feature change is made
that is desirable for both codelines, I merge that change into the
other. This was easy at first, but as the underlying architectures
diverge, it has become more difficult.</p>
<p>One problem is that we are using SourceSafe, and I can't find any good
features for assisting in analyzing the differences between branches to
intelligently decide what needs to be merged and what does not. At the
level of individual files, branches can be merged, but I can't find an
easy way to get a report of all changed for all files in both codelines
and to merge individual sets of changes. (Maybe SS has better features,
but I can't find them.) So we have had an informal manual process, which
relies on other people telling me about things that have to be merged,
and on my having time to do the merge.</p>
<p>This situation sucks, so what I decided to do about it was to write some
Python scripts to help me. The first script I've written just compares
the files in two directories, and writes diff files to a third
directory. My hope was that this would give me a list of a dozen or so
non-matching files, and I could spend the weekend getting everything
back in shape. I'd then just run the script every few days to find new
changes.</p>
<p>Unfortunately, when I ran the script, I found that the number of
non-matching files was 135. Each codeline also has a few dozen files
that are unique (that is, not corresponding to a file in the other
project). Clearly, this is going to take more than a weekend.</p>
<p>I'm not sure exactly what I should have done to prevent things from
getting so bad. Obviously, having one person (myself) be the only person
working on synchronization between the codelines was a problem. Not
having automated unit tests is another factor, because without such
tests, it is dangerous to have changes merged back and forth without a
lot of analysis. A better version-control tool would have helped,
particularly one that supports merging an identifiable set of related
changes to multiple files rather than forcing an all-or-nothing merge of
all changes on a file-by-file basis.</p>
<p>Ultimately the core problem is that our original codeline had to be
thrown together hastily, leading to code that is difficult to adapt to
our new requirements while still meeting the old requirements. So I can
blame management for not giving us sufficient time. Unfortunately,
management isn't going to fix my problem for me, so I'll be working this
weekend.</p>
<p>(For another story about branching/merging issues, I recommend the story
of <a href="http://weblogs.asp.net/Rick_Schaut/archive/2004/02/26/80193.aspx">Mac Word 6.0</a>.)</p>
</div><!-- /.entry-content -->
</section>
<ul>
<li>Previous article:
<a href="https://undefinedvalue.com/what-can-one-person-do.html">
What Can One Person Do?
</a>
</li>
<li>Next article:
<a href="https://undefinedvalue.com/nyc-crosswalk-buttons-dont-do-anything.html">
NYC Crosswalk Buttons Don't Do Anything
</a>
</li>
</ul>
</div><!-- /.nine columns -->
<div class="three columns">
<section id="extras" class="body">
<div class="recent">
<h2>Recent Posts</h2>
<ul>
<li><a href="https://undefinedvalue.com/simpler-résumé-updates.html">Simpler Résumé Updates</a></li>
<li><a href="https://undefinedvalue.com/54.html">54</a></li>
<li><a href="https://undefinedvalue.com/53.html">53</a></li>
<li><a href="https://undefinedvalue.com/menubar-countdown-21.html">Menubar Countdown 2.1</a></li>
<li><a href="https://undefinedvalue.com/lunar-for-c-and-rust.html">LUNAR for C and Rust</a></li>
</ul>
</div><!-- ./recent -->
<div class="blogroll">
<h2>Other Stuff</h2>
<ul>
<li><a href="http://secretspacelab.com/tcm.html">What's Good on TCM?</a></li>
<li><a href="https://github.com/kristopherjohnson">GitHub</a></li>
<li><a href="https://bitbucket.org/KristopherJohnson/">Bitbucket</a></li>
</ul>
</div><!-- /.blogroll -->
<div class="social">
<h2>Follow</h2>
<ul>
<li><a href="https://undefinedvalue.com/feeds/all.atom.xml" type="application/atom+xml" rel="alternate">Atom Feed</a></li>
<li><a rel="me" href="https://mastodon.xyz/@oldmankris">Mastodon</a></li>
<li><a rel="me" href="http://stackoverflow.com/users/1175/kristopher-johnson">Stack Overflow</a></li>
<li><a rel="me" href="http://www.linkedin.com/in/kristopherdjohnson">LinkedIn</a></li>
<li><a rel="me" href="https://www.flickr.com/photos/kristopherjohnson/">Flickr</a></li>
<li><a rel="me" href="http://twitter.com/OldManKris">Twitter</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
</div><!-- /.three columns -->
</div><!-- /.row -->
<div class="row">
<footer id="contentinfo" class="body">
© 2003-2023 Kristopher Johnson
</footer><!-- /#contentinfo -->
</div><!-- /.row -->
</div><!-- /.container -->
</body>
</html>