vendor-branching

Vendor Branching using XXX

The following sequence is almost identical for creating as well as updating a vendor and could serve as a compact generic checklist too.

. switch to vendor branch

# create (if possible orphan) or switch to vendor branch
switch --orphan $VENDOR_BRANCH
switch --create $VENDOR_BRANCH
switch $VENDOR_BRANCH

For the "why" of the orphan branch, see the Git page.

. empty vendor directory

cd $LOCAL_VENDOR_DIR
rm -rfI * # be careful...

.. "sibling" vendor drop (i.e. vendor uses XXX)

git subtree add / pull --prefix=$LOCAL_VENDOR_DIR $URL $VERSION

.. "alien" vendor drop (vendor does not use XXX)

wget $ZIPFILE_URL
unzip $ZIPFILE
#etc

Rename the directory if it contains version names!

. commit & tag the vendor branch

commit $VENDOR_BRANCH
tag $VENDOR_BRANCH $TAG

. switch to your task branch

switch <taskbranch>

. merge vendor branch

Note: this is the step where things could get hairy or even ugly, when the vendor does lot's of refactoring, renaming, etc.

merge $VENDOR_BRANCH
handle conflicts...

. update VENDOR file in the vendor directory

edit $LOCAL_VENDOR_DIR/VENDOR.md # (unless VENDOR.sh runs the vendor drop)

VENDOR.md could also be a VENDOR.sh file that executes a vendor drop. As the next vendor drops are similar, a script is recommended! See examples for

. tweak vendor code

hack away

. merge to main branch

switch main
merge task branch

. publish

push main branch
push vendor branch
push vendor tag

Notes (if any)

todo

How to deal with vendors that were initially copy-pasted without using the VB pattern