Development

This section describes how to get started with your own development.

Your Own Git Repo

You will want to begin with setting up your own Git repo. If you are unfamiliar with Git, then you should read up on it, and/or do some tutorials. It is beyond the scope of this documentation to teach Git.

There are some 3rd party Git GUI tools that you could use to help, especially if you don’t like the command line interface of Git. Consider these,

https://www.gitkraken.com/git-client (not free, works everywhere)

https://www.sourcetreeapp.com (free, Windows/Max only)

https://git-scm.com/download/gui/linux (list of others)

To get started, create yourself a guthub account.

There are two ways to being using TMI with Git,

The first way, is to fork the tmi_scripts repo to your own github repo. This is the easiest way to get started, but it has the draw back that all git forks must be public, and its very unlikley that you want that. So the forking method will not be used below, but you may use it if you want.

The second way is to clone tmi_scripts and push it to your own repo. Detailed instructions are shown below

  • Create a new repository at github.com. (this is your repository)
    • Give it the same name as TMI repository, tmi_scripts
    • Don’t initialize it with a README, .gitignore, or license.
  • Clone the tmi_scripts repository repository to your local machine. (if you haven’t done so already)
git clone https://github.com/mgagcode/tmi_scripts.git
  • Note that the tmi_scripts clone will be created under your current directory. Some prefer all their repositories to be under a common directory, so you might actually do something like this,
mkdir ~/git
cd ~/git
git clone https://github.com/mgagcode/tmi_scripts.git
  • Rename the local repository’s current ‘origin’ to ‘upstream’
git remote rename origin upstream
  • Give the local repository an ‘origin’ that points to your repository
git remote add origin https://github.com/your-account/tmi_scripts.git
  • Push the local repository to your repository on github
git push origin master
  • Now ‘origin’ points to your repository & ‘upstream’ points to the other repository
  • Create a new branch for your changes with
git checkout -b my-feature-branch
  • You can git commit as usual to your repository
  • To pull changes from TMI tmi_scripts to your master branch use,
git pull upstream master
  • You want to be able to pull from TMI tmi_scripts occasionally to get TMI updates to scripts, and/or examples, drivers, etc.

Repo Setup

Additional steps.

Install Git Hooks

In the tmi_scripts repo, there is a folder called hooks. The contents of this folder needs to be copied to ./.git/hooks folder of your repository.

Depending on your directory structure, this example command may work,

cd ~/git/tmi_scripts
cp hooks/* ./git/hooks

Create a Tag

The TMI system reports the version of things to help keep you organized, including the version of your scripts.

On whatever branch you decide to “release” your scripts, for example, the “master” branch, create a tag on that branch. The tag MUST be of this format,

Name-V.v

where:
    Name - is anything you want, keep it short, say <8 characters
    V - is major revision, manually increased by YOU, be making a new Tag
    v - is minor revision, manually increased by YOU, be making a new Tag

Example commands to create (and push) a tag,

git checkout master
git tag MyTest-1.0
git push origin --tags

There should only be one tag in effect at a time, and `tmi_scripts` has a tag already, remove that tag,

git checkout master
git tag --delete TMIScripts-0.1
git push origin --tags

There should only be one tag in effect at a time, so remove a previous tag. Here is the sequence to change the minor version,

git checkout master
git tag --delete MyTest-1.0
git tag MyTest-1.1
git push origin --tags

Change README.md

Change this file to suit your needs. For example, document your script/program naming strategy.