-
Notifications
You must be signed in to change notification settings - Fork 2
Docs and customised paths #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
83ab6d9
e62dd29
43b6a1f
8699728
8750fce
9f1dd8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Terms and Variables Defined | ||
|
|
||
| ## Terms defined and orhan terms | ||
|
|
||
| - `BRANCHOUT_NAME` - The common name for both the meta project directory and cache/settings directory for a given project. | ||
| - `BRANCHOUT_FILE` - The file name in the meta repo with the basic setup of the project tree, such as the above. Can be called either `Branchoutfile` or `.branchout`. | ||
| - `BRANCHOUT_PROJECTS` - The file name in the meta repo where the project names are listed in raw form with prefix (if any) and group. Can be called either `Branchoutprojects` or `.projects`. | ||
| - `BRANCHOUT_STATE` ? - **TODO** This one is the settings/cache dir specific to current meta project? Is the name appropriate? To me state of a set of repos is git status run across all of them, not maven settings and repo cache. | ||
| - `PROJECTION_DIRECTORY` ? - **TODO** This one stands out like a sore thumb - rename to `BRANCHOUT_PROJECTION_DIR`? | ||
| - `BRANCHOUT_PROJECTS_DIRECTORY` ? - **TODO** sub directory under home under which branchout meta projects live - needs to be independent of ${HOME} | ||
| - `BRANCHOUT_STATES_DIRECTORY` ? - **TODO** doesn't yet exist, equivalent to the above, but for the settings/caches directory structure for each meta project. | ||
| - `BRANCHOUT_GIT_BASEURL` - The prefix for all git repos included in a particular branchout meta project. Derived, but can be overriden in case the base project differs from the rest (unlikely). | ||
| - `BRANCHOUT_PATH` - The path under which the `branchout` script lives and under which it knows it can find its siblings in order to explicitly call them rather than relying on them being on the path (which breaks if the script is called with a direct call and isn't on the path). | ||
|
|
||
| ## Definitions needing a home above | ||
|
|
||
| 1. The root directory where branchout meta projects live side by side with each other. Where the branchout init process places new meta projects in folders called `BRANCHOUT_NAME`. | ||
| 2. The root directory where branchout places project-specific folders called `${BRANCHOUT_NAME}` side by side with settings and cache directories for different tooling nested beneath. | ||
| 3. ? | ||
| 4. ? | ||
| 5. ? | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,35 +40,94 @@ brew tap Branchout/homebrew-branchout | |
| brew install branchout | ||
| ``` | ||
|
|
||
| ### Initialise an existing organisation | ||
| ### Initialise an existing or new organisation | ||
|
|
||
| To start with an existing project just init it from the git url | ||
|
|
||
| ``` | ||
| branchout init https://github.com/Branchout/branchout-reactor.git | ||
| branchout init https://github.com/Branchout/branchout-reactor.git [optionalDirName] | ||
| cd ~/project/branchout-reactor | ||
| branchout status | ||
| branchout pull | ||
| ``` | ||
|
|
||
| This will create the Branchoutfile and Branchoutprojects if needed | ||
| This will create the Branchoutfile and Branchoutprojects if needed, for example if the repo is new/empty and you're setting it up for the first time. | ||
|
|
||
| The default branchout name is the name of the root project | ||
| The default branchout name is the name of the root project, but can be overridden. | ||
|
|
||
| You can now add projects | ||
| ```branchout add <project-name>``` | ||
|
|
||
| They will show as not cloned until you ```branchout pull``` | ||
| ``` | ||
| branchout add <project-name> | ||
| ``` | ||
|
|
||
| They will show as not cloned until you `branchout pull` | ||
|
|
||
| If you want to clone when you add | ||
| ```branchout clone <project-name>``` | ||
|
|
||
| ``` | ||
| branchout clone <project-name> | ||
| ``` | ||
|
|
||
| ### Need to trust a certificate or ca bundle | ||
|
|
||
| If you have a corporate CA bundle that you need to trust just add it at `<metarepo>/.branchout/cacerts` | ||
|
|
||
| branchout-yarn will configure the environment so that yarn can trust certificates in or signed by certificates in cacarts | ||
|
|
||
| ### Common config in Branchoutfile | ||
|
|
||
| #### Repo name prefixes | ||
|
|
||
| If in your git structure your repos are all commonly prefixed with the same thing, and you'd like that to be ignored by Branchout as a prefix, then add: | ||
|
|
||
| ``` | ||
| BRANCHOUT_PREFIX=prefix-without-trailing-hyphen | ||
| ``` | ||
|
|
||
| to the Branchoutfile and you'll get whatever the next hyphen-separated part is used as the group for directory layout. | ||
|
|
||
| #### Branchout name override | ||
|
|
||
| In case of your branchout repository having a long name that you don't want as part of the two branchout paths, you can override by adding: | ||
|
|
||
| ``` | ||
| BRANCHOUT_NAME=shorter-name | ||
| ``` | ||
|
|
||
| to the Branchoutfile and ideally use the same value as the optionalDirName during branchout init. | ||
|
|
||
| ### Personal customisation | ||
|
|
||
| Sometimes the branchout defaults don't work for a particular scenario even though they do work for most of your colleagues. | ||
| One example is that the `${HOME}` places the two root directories on a very slow network drive. | ||
| Another might be that you already have a tree with your code and you want to keep it all together. | ||
| In cases like these you can use the following two files to ???? | ||
|
|
||
| ``` | ||
| ~/.config/branchoutrc | ||
| ${BRANCHOUT_STATE}/.branchoutrc - Can the decision to make this a dot file be reversed? What was behind that? Seems like the sort of thing you'd want to wave a flag at you, not hide ready to bite. | ||
| ``` | ||
|
|
||
| #### PROBABLY NOT TRUE: | ||
|
|
||
| Branchout settings have an override hierarchy as follows: | ||
|
|
||
| - Built in defaults and behaviours in scripts are the first layer intended to minimise config by convention | ||
| - `Branchoutfile` is read next and all values used from here over the built-in ones | ||
| - `~/.config/branchoutrc` is read next and any values here are used over either of the two sources above | ||
| - `${BRANCHOUT_STATE}/.branchoutrc` is read next and is the final project-specific personal override possible | ||
|
|
||
| Branchout then goes about performing its normal duties on the basis of this layered configuration approach. | ||
|
|
||
| #### Moving the branchout projects base dir | ||
|
|
||
| To set the root of where branchout initialises branchout repos do XXX | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. set BRANCHOUT_PROJECTS_DIRECTORY in ~/.config/branchoutrc
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stickycode Is this true? Where I saw this used it was used on top of Do we need a new variable that overrides both this and the base path being $HOME or just a wrapper layer around home that uses home as a default and lets you override it to eg / or wherever else you want it? |
||
|
|
||
| #### Moving the branchout caching base dir | ||
|
|
||
| To set the root of where branchout stores project specific caches and settings/credentials do YYY | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i guess this should be similar BRANCHOUT_STATES_DIRECTORY in ~/.config/branchoutrc
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See other comments above, if we keep this relative to the current $HOME and then just move the base of both that could be good enough, or might be better to have the two base values also be separate? |
||
|
|
||
| ## Grokking the code and contributing | ||
|
|
||
|
|
||
|
|
@@ -84,7 +143,7 @@ brew install git bats-core shellcheck | |
|
|
||
| The tests are written in bats https://github.com/bats-core/bats-core | ||
|
|
||
| Note, the ```sstephenson/bats``` repository is unmaintained, bats-core is what you want. | ||
| Note, the `sstephenson/bats` repository is unmaintained, bats-core is what you want. | ||
|
|
||
| ``` | ||
| make test | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see this is the problem... they should work for everyone or no one... there aren't really special cases for people although the org might be special
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a step back. What's important about this tool is NOT conformity and control of author over the world.
What's important about this tool is:
And all of that stuff is GREAT and a good reason for me to burn my personal time on this in the coming months, happy to become contributor number two to your project/great idea! :-D
Where on your disk those two roots are is NOT important, not even when you share a path to a colleague, unless they're of below average intelligence. The only part of the path that is key to consistency/understanding should be the BRANCHOUT_NAME within those two root directories, wherever they are. Typically paths I give to colleagues are in the context of the repo that the discussion is about, eg
src/main/java/or whatever, not full absolute paths that may mean nothing on their disparate operating systems anyway.On my machine ~/ is cleared out every night at 4am against a whitelist so I had to update that whitelist to add two more entries and every time I
ls -al ~/I see ~20% extra stuff that I don't want to. My personal structure after this is changed will be:~/repos/branchoutRootsand
~/repos/branchout/cacheAndSettingsRoots/then it'll all be in one place, nice and handy right next to my not-yet-managed-by-branchout structures that I'd LOVE to port over :-D
I've told you before, I love this project. And I've also told you, it doesn't 100% work for me, yet. This is a step in the right direction that will also help many others with unpleasant usage situations to deal with get the best out of the tool in environments that they don't fully control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds reasonable