I wrote and maintain a medium sized website with about 1K active users.
I use technologies like Ubuntu, Python, Django, jQuery, Less, twitter-bootstrap and many more, and all the dependencies they bring along. I have a half-ton of external components, like JS libraries that I downloaded from the Internet, and a few projects I have forked on GitHub because I needed to change. Some Python projects I have installed with pip
.
I have also made changes to JS libraries downloaded online, and everything is now in my repository. The forked projects are available as git submodules within my repository.
After 1.5 years of development, I'm realizing that this was a terrible approach. Upgrading any component would be potentially really messy. It's hard for me to keep track of versions, and I'm afraid of upgrading single components (be it a python package I installed with pip, or a javascript library, or something else) because that might cause regressions gods-know-where.
Last night I started thinking that, instead of forking things like there's no tomorrow, I should have probably maintained a set of patches, applied via Makefile.
Would I have been better off? what are your thoughts?
Thanks in advance.
I've had some experience with this recently. I've been modifying sets of files that our lab uses in order to port the files to a newer version of the language they use, but in parallel, others have been customizing their own versions of the files to suit their needs. So what I need is a way to patch my changes on top of their customized versions.
The way I've been doing this is not to use git or Make (I use both of these on a daily basis), but to use OS X's visual FileMerge utility. I assume that all of the differences between my customized code and their code default to their code initially, then I go down the line through all of the changes, and if any belong to my customized code, I patch them over to their code.
It's manual, but OS X's visual FileMerge utility makes it relatively quick and painless. By relatively painless I mean that I can do the whole merge with my right hand never leaving the four arrow keys, and never using the mouse. And honestly, I'm not sure if this sort of patching can be automated. I've had to make decisions when doing the merge that I'm not sure could be easily left up to some sort of automated patching system.
That said, I have been amazed at some of the things that git's merge algorithm has successfully merged.
This is a great question. Thanks for the post. And I know this isn't a definitive answer, but these are my current thoughts on the matter, for what they are worth.