Go to the website for this page: https://axd1967.github.io/vendor-branching/ Author: alex

Someday ImageMagick will finally break for good and we'll have a long period of scrambling as we try to reassemble civilization from the rubble. explainxkcd
Just read this very short Wikipedia paragraph that explains the concept. Still here? Read another Wikipedia paragraph to find out why it is an important pattern.
The problem is comparable to people realizing they need tables for their business. So they think ... "spreadsheets that's what i need!" And many years later some still don't understand they should have chosen the database path. The brave ones face the challenge to convert spreadsheets to databases. Many will never make the shift.
This project is still WIP and expanding...
Please read this page to find out.
You may use vendor branching to do that :-J
You copied artefacts from a fancy place to your favourite VCS, tweaked it and now you discover that meanwhile the fancy place updated their code. What now? Artefacts can be source code, data files, PDF files, supporting documentation...
This document is the zillionth attempt at explaining the vendor branching mechanism. Despite the Internet abound with how-to's, developers keep falling in the trap.
There is more: this is related to the concept of the software supply chain.
In short: copy-pasting artefacts is a seemingly easy way to get things imported in a project. The problem is the maintainance effort that will follow. Do not assume the data is "written in stone" and will never change any more (be it inside your project or externally). Instead, every time you import anything from outside your project, be it code or data, do not bluntly copy-paste; don't just create a "fork" of foreign artefacts unless there really is no other way.
Unless you want to produce a hostile fork...
Sometimes this problem is then solved by manual labor: porting external changes is a laborous approach prone to bugs. Extremely instructive use cases are presented on Wikipedia.
Usually references of some form are added to the source code, e.g. ftp, snail mail, http, ... The problem is that these references might disappear at some point in the future. This happens all the time with personal pages. An example can be found in this comment: you will get a 404: the pages are gone. Those pages should somehow have been imported as vendor data.
The approach looks daunting, but that is only appearance.
The external (source) version of such artifacts will often continue to evolve, but these modifications obviously will not be magically reflected in your project repository, thus sometimes, if not often leading to artifacts slowly getting totally outdated (hence the term "code rot").
First, there are cases that I'm personally interested in, and are discussed separately:
Don't take it personally: the issue is widespread and totally forgiveable, as the pattern is seldom taken into consideration when a solution is needed for this typical problem.
More examples can be found here.
Sometimes this can be solved by using package managers that automate the importing and updating of external "stuff" (typically code) and - important - allow to fine tune / pin which version is to be imported.
But package managers do not allow to modify the imported code out of the box and benefit from external updates.
Also, package managers are not always the easiest way to deal with vendors, sometimes due to a lack of experience of contributing developers (that often are volunteers with diverse backgrounds and often come and go with drive-by contributions).
Vendor branching is far easier to work with than configuring package managers, as all the required knowledge resides in how to deal with branching.
pip -e is a great example of this. Modifying the vendor code is less great.And sometimes there will be no package manager provided with the artefact. Often, the artefacts will live in zip or PDF files or HTML pages...
The idea is not to import the vendor artefacts, but create (and store in the repo) patches that patch the vendor at compile/make/... whatever time.
An advanced solution might be Not-forking.
Prior note: it is obvious that the problem is widespread, and it is unlikely that the affected projects will change the chosen path (don't fix what isn't broken?)... So this whole discussion is mainly oriented to those who are still fresh in the discipline... And especially towards devs that are about to commit a "copy-paste offence".
Vendor branching is far easier to work with than working with package managers, as all the required knowledge resides in how to work with branching (and merging).
The concept already exists:
git subtree).Importing external artifacts requires a specific (and in this case a simple - believe me, it is not rocket science - as well as generic) and approach: the Vendor Branch approach. The proposed approach is KISS: simple to apply to novice programmers. By the way, the approach is valid in any VCS, such as SVN, Git, Mercurial, ClearCase, Fossil, TFS, CVS (where it already exists), you name it.
Importing external artefacts in vendor branches will also provide insight in what changed in those artefacts, just by inspecting the "diff" between successive vendor versions. Normally such changes should also be announced by the vendor.
Even if you think you will never change anything (which cannot be guaranteed), applying the VB pattern will promote the practice.
This is in fact an important version control pattern.
main branch)See the page systems for the more detailed steps using various VCS.
Interestingly, one could also use the same concept when "subcontracting" your code as vendor code to an outside contractor company.
main.fossil open inflates to 17M.git/ vendor drop of that repo takes 5.1M (8.3M but then cleaned by git gc)vendor-branching topic:

You say no human would reply to a forum thread about Tom Bombadil by writing and editing hundreds of words of text, complete with formatting, fancy punctuation, and two separate uses of the word 'delve'. Unfortunately for both of us, you are wrong. explainxkcd