English 中文(简体)
Best practices to keep up a diverging branch of code [closed]
原标题:

Closed. This question is opinion-based. It is not currently accepting answers.


Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 7 years ago.

I m in a situation where some minor patches I ve submitted to an open-source project were ignored or explicitly not accepted. I consider them useful, but more important is that I need the functionality they implement.

I don t want to push my ideas and suggestions anymore to the main contributors, because I don t want to turn this into an ego issue. I ve decided that my best bet would be just to use what I wrote for my own purposes. I don t want to fork the whole source code tree because I like how things are generally working, I m just not happy with details.

But I do realize that the project will evolve and I would like to use the new features that will eventually appear. I understand that I ll have to merge all new things into my own source tree. Are there any best practices for this scenario?

最佳回答

If you are using Git, or could get used to use it, perhaps you should take a look at Stacked Git or Guilt.

They are layers on top of Git to keep track of patches.

问题回答

The standard approach is to maintain a vendor branch in your repository. The idea is that you import a pristine copy of the original sources (called a vendor drop) into your local repository, and store it on a branch. This is the version of the code prior to applying your mods. You tag that with the version, then copy it to the main trunk and apply your patches.

When subsequent new versions of the vendor code are released, you check out the vendor branch (without your mods), and overlay the new version on top. Finally you merge the new branch with your mods, checking that they are still applicable/relevant, and you re ready to go again.

There can be complications e.g. with files being renamed, deleted etc. The script svn_load_dirs.pl, that comes with Subversion, can help with this by allowing you to identify files which have changed name and automating some of the bureaucracy.

This approach is discussed in detail (and much more clearly) in the Subversion book, under the section Vendor Branches.

Generally you would create a branch of the project in the repository. In your specific case, I would create a branch of just the directory that contains your code if that is possible. A lot of repositories like subversion will allow you to then check out your branch along side the main trunk. That should allow you to maintain your patches and ensure that they work with future changes that are made to the trunk.





相关问题
Tracking Versions, Builds, Revisions, with TortiseSVN

I am the sole developer on a project and have been using tortoiseSVN for quite a while. Now Id like to start getting version information working correctly in the project I.E. show Major Version, Minor ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

How to handle different csproj [closed]

I am working in a team of five. We are working on a C# application with five csprojects. The problem is that for each csproject, each of my colleagues has their own ideas on how to reference a DLL; ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...

热门标签