logging my workflow - luminize/subtree GitHub Wiki

Refactoring documentation

Note

This is the log of me, trying to fit change the way of documenting for the Machinekit project. With this I’m testing the workflow for enhancing the documentation.

I made 3 git repositories on github/luminize

  1. upstream

  2. enhancement

  3. subtree

Locally I made 3 directories files in a git repo and added /docs/src directory to upstream

Note

upstream means "LunixCNC"

enhancement means "Machinekit"

subtree means "/docs"

further the situation I made is:

  1. upstream has the remote upstream

  2. enhancement has the remotes upstream-source and enhancement

  3. enhancement has the branches

    • upstream-branch and is tracking upstream-source/master

    • master and is tracking enhancement/master

    • subtree-branch (in which this log is held). and is tracking enhancement/subtree-branch

switch to a branch with git branch checkout <branch name>. and then type git branch -u <remote name>/<branch name>

if you want to see which branch is tracking what type git branch -vv it then will give output like something like this in the enhancement repo:

  master          c216105 [enhancement/master] add /docs and /docs/src with textfiles§
* subtree-branch  9c1645c [enhancement/subtree-branch] log: add more info about remote branches and tracking
  upstream-branch 8216473 [upstream-source/master: ahead 2] log: add more steps and info

update done in upstream

when some change is done in upstream then the following must happen:

  1. upstream/master (a.k.a. upstream-source/master) pulled into enhancement/upstream-branch

  2. enhancement/master is the branch to which updates and new stuff that is usable are are being applied from enhancement/upstream-branch

  3. then

testing the workflow

  1. change a file in local upstream

  2. push to upstream

  3. in local enhancement/upstream-branch pull upstream-source/master

  4. in local enhancement/master rebase onto enhancement/upstream-branch

  5. then add a little correction into the new file

  6. commit

  7. in local enhancement/subtree-branch rebase unto enhancement/master

  8. push both subtree-branch and master to github.

testing renaming to .asciidot

here I’ll test how the renaming of .txt in enhancement/subtree-branch will work with changes from upstream. So the same as the next test, but at the same time a file is changed in upstream i’ll rename a docyment in /docs/src from the enhancement/subtree-branch.

split operation

see this file for the output of the split operation. Needs to be touched up

pushing to subtree/master after commit in enhancement/subtree-branch

now there comes a time when changes need to be pushed to the subtree repo.

I made a commit in enhancement/subtree-branch in the /docs directory. for pushing to the subtree remote you need to do `git subtree push --prefix=<directory> <remote> <branch of remote>

Bass-MacBook-Pro-3:enhancement basdebruijn$ git subtree push --prefix=docs subtree master
git push using:  subtree master
-n 1/       5 (0)
-n 2/       5 (0)
-n 3/       5 (0)
-n 4/       5 (1)
-n 5/       5 (2)
Counting objects: 9, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 2.84 KiB | 0 bytes/s, done.
Total 7 (delta 4), reused 0 (delta 0)
To https://github.com/luminize/subtree.git
   bfbee0d..d2c9f57  d2c9f57c23845c99970dcb626fb8f5dd9af27987 -> master

the next point will be me pulling the changes I do to this file on-line in subtree repo.

pulling from subtree/master in enhancement/subtree-branch

you need to do git subtree pull --prefix=<directory> <remote> <branch of remote> see output:

Bass-MacBook-Pro-3:enhancement basdebruijn$ git subtree pull --prefix=docs subtree master
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From https://github.com/luminize/subtree
* branch            master     -> FETCH_HEAD
  d2c9f57..27c91be  master     -> subtree/master
Auto-merging docs/logging my workflow.asciidoc
CONFLICT (content): Merge conflict in docs/logging my workflow.asciidoc
Automatic merge failed; fix conflicts and then commit the result.
Bass-MacBook-Pro-3:enhancement basdebruijn$ git pull --abort
U	docs/logging my workflow.asciidoc
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution, or use 'git commit -a'.
Bass-MacBook-Pro-3:enhancement basdebruijn$ git commit -a
[subtree-branch 25b478a] Merge commit '27c91beaaa5e53d7be9b1eca3c8b672d9b14001e' into subtree-branch
I'll try once again to change in the github environment in `subtree, commit and pull back locally in enhancement/subtree0branch I keep getting merge conflicts when pulling subtree into enhancement/subtree-branch. I’ll try again, but then in the subtree which was split when adding the original stuff back into the enhancement repo. I need to pull when I’m into the enhancement/subtree branch which was created at the time of the originial adding of the subtree to the repo == easy adding to the documentation If I am correct then the "/docs" should go als in subtree.wiki.git as that will be easily modified by other people. I will test this later.

Then modifications from Github can be pulled into subtree

test for inter document linking asciidoc markup split operation

⚠️ **GitHub.com Fallback** ⚠️