This directory contains the forked subtrees of the tensorflow
and tensorflow_serving
projects which provide the project with TensorFlow protobuf definitions.
They should only be updated to pull changes from the original upstream projects using git subtree
commands.
- Clone this repo
- Set the upstream remote to the parent tensorflow repo and/or tensorflow_serving repo
git remote add upstream-tf [email protected]:tensorflow/tensorflow.git
git remote add upstream-serving [email protected]:tensorflow/serving.git
This should set up a new master branch for each upstream (upstream-tf/master
and upstream-serving/master
) and copy all of the upstream refs into your local.
This is a very similar process for tensorflow
and tensorflow_serving
- the main difference is that tensorflow
is much bigger than tensorflow_serving
, so it will take longer (possibly up to an hour).
- Pull the updated upstream refs:
git fetch upstream-tf
Now upstream-tf
is up to date.
Also fetch the upstream tags (since we use two upstreams, it's a good idea to use a refspec to keep tags organised.
git fetch upstream-tf '+refs/tags/*:refs/rtags/upstream-tf/*'
- Check out the ref you want to update to:
git checkout refs/rtags/upstream-tf/<version>
- Create a
upstream-tf-subtree
branch containing the subtree fromupstream-tf
. This command will take a while -tensorflow/tensorflow
is big.
git subtree split --prefix tensorflow --onto upstream-tf-subtree
- Create a new branch in the
min-tfs-client
tree with cleanprotobuf_srcs/tensorflow
.
There doesn't appear to be a way to use git subtree
commands to cleanly pull the subtree changes into a branch, especially since tensorflow repos do their own fancy git rework which complicates things. Therefore the recommended approach is to use base git
to ensure a clean history.
git checkout master
git checkout -b <new-branch>
rm -rf protobuf_srcs/tensorflow
git add --all && git commit -m "[WIP]"
- Merge the subtree into
protobuf_srcs
:
git subtree add --squash --prefix protobuf_srcs/tensorflow upstream-tf-subtree
- Clean the commit history:
git reset --soft master
git add protobuf_srcs/tensorflow && git commit
It helps to include a descriptive PR commit message which mentions the upstream git ref used, e.g.
Squashed commit of tensorflow changes
tensorflow/tensorflow commit [<version>]: <commit SHA>
- Push and raise a PR for
<new-branch>
againstmaster
git push -u origin HEAD
- Pull the updated upstream refs:
git fetch upstream-serving
Now upstream-serving
is up to date.
Also fetch the upstream tags (since we use two upstreams, it's a good idea to use a refspec to keep tags organised.
git fetch upstream-serving '+refs/tags/*:refs/rtags/upstream-serving/*'
- Check out the ref you want to update to:
git checkout refs/rtags/upstream-serving/<version>
- Create a
upstream-serving-subtree
branch containing the subtree fromupstream-serving
.
git subtree split --prefix tensorflow_serving --onto upstream-serving-subtree
- Create a new branch in the
min-tfs-client
tree with cleanprotobuf_srcs/tensorflow_serving
.
There doesn't appear to be a way to use git subtree
commands to cleanly pull the subtree changes into a branch, especially since tensorflow repos do their own fancy git rework which complicates things. Therefore the recommended approach is to use base git
to ensure a clean history.
git checkout master
git checkout -b <new-branch>
rm -rf protobuf_srcs/tensorflow_serving
git add --all && git commit -m "[WIP]"
- Merge the subtree into
protobuf_srcs
:
git subtree add --squash --prefix protobuf_srcs/tensorflow_serving upstream-serving-subtree
- Clean the commit history:
git reset --soft master
git add protobuf_srcs/tensorflow_serving && git commit
It helps to include a descriptive PR commit message which mentions the upstream git ref used, e.g.
Squashed commit of tensorflow serving changes
tensorflow/tensorflow_serving commit [<version>]: <commit SHA>
- Push and raise a PR for
<new-branch>
againstmaster
git push -u origin HEAD