Loading repository data…
Loading repository data…
BradleyA / repository
Bash script that adds Git Version Control information into files and pushes them to GitHub, Bitbucket, or GitLab (Supported files: Bash, Go, Dockerfile, YAML, Makefile, Scala, Python, Java, PHP, C, C++, JavaScript, perl, ruby, PowerShell, Ri, . . .)
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Bash script that adds Git Verion Control information into files and git add, git commit, git pushes them to GitHub, Bitbucket, and/or GitLab. Most scripts in this repository support --help and --usage options.
Markit is a bash script that is a wrapper around these Git commands; git add ${FILE_NAME}, git commit -m "${FILE_MESSAGE}", git tag -a ${RELEASE_VERSION}, and git push --follow-tags. It automates this Git commit process and adds two comment lines of metadata about file changes to all tracked modified files in your local Git repository. This metadata allows any person to answer the question; What version are you running?
Markit supports Semantic Versioning (MAJOR.MINOR.PATCH) and alphanumeric versioning (1.2.5-beta.1). Markit will display the current version before prompting you to enter the next version. Markit includes the number of commits with the version in the file(s). I find this helpful when commiting several different changes while working on the same PATCH.
If environment variable MARKITLOCAL is set to 1, markit automates this git commit process, but does not push to GitHub repository or Bitbucket repository or GitLab project. I find this helpful when working without network access to a remote Git repository. If using the bash shell, enter; 'export MARKITLOCAL=1' on the command line to set the MARKITLOCAL environment variable to '1'. Use the command, 'unset MARKITLOCAL' to remove the exported information from the MARKITLOCAL environment variable. You are on your own defining environment variables if you are using other shells.
The two comment lines of metadata include:
Markit currently supports files with these file extensions:
c(c), C++(cc|cpp|c++|cxx), C header(h|H|hpp), C++ header(hxx|Hxx|HXX), Go(go), HTML(html|htm), Java(java|class|jar), JavaScript(js), Kotlin(kt|kts), Makefile(mk|MK), Pascal(p|pp|paa), Perl(pl|PL|psh), PHP(php|php3|php4|ph3|ph4), PowerShell(ps1|msh), Python(py), R(R), Ruby(rb), Rust(rs|rlib), Scala(scala|sc), Shell(sh|bash|csh|tcsh|ksh), Terraform(tf|tfstate), Text(txt), XML(xml), YAML(yml|yaml)
Markit currently supports these files without file extensions: Dockerfile, Makefile. There will be a prompt to add comment character(s) for unknown file names when needed and a prompt to add a description about the changes.
To fork a GitHub repository you need to be logged into your GitHub account.
Go to repository https://github.com/BradleyA/markit
Click the fork icon in the upper right
Enter the following command with the name of your repository,
git clone https://github.com/<YOUR-USERNAME>/markit.git
Change into the cloned directory on your Linux system.
cd markit
Make any change to testfiles/sample.sh.
vi testfiles/sample.sh
Run ./markit and enter the next version number when prompted and a brief description of the changes to testfiles/sample.sh. You will be prompted for your GitHub password when Git pushes testfiles/sample.sh to your remote GitHub repository.
./markit
That is it!
Check if your local version of testfiles/sample.sh is the same version that is on your remote Git repository.
./check-markit -f ./testfiles/sample.sh
On GitHub go to your Forked markit repository settings page and check the box next to Issues. Then open the first GitHub issue on your forked markit Git repository, #1.
Modify test file, testfiles/sample.sh, by adding a blank line to learn how markit works.
vi testfiles/sample.sh
#!/bin/bash
# testfiles/sample.sh 3.197.368 2019-02-08T20:33:53.600661-06:00 (CST) https://github.com/BradleyA/markit uadmin six-rpi3b.cptx86.com 3.196-1-g46f4c0d
# test markit for sample.sh
#
# ./sample.sh
###
echo "Hello World"
Run ./markit. Enter the next version number when prompted and this brief description 'testing markit issue changes close #1'. You will be prompted for your GitHub password when git pushes testfiles/sample.sh to your remote forked markit Git repository.
./markit
The file testfiles/sample.sh has been updated with metadata, git tag, git commit, git push, and the issue #1 on GitHub has been closed.
View ./markit help pages to learn more about how markit works with tracked and untracked files and without network access to remote Git repository.
./markit --help
Continue testing with the other test files to help you integrate markit with your development solutions. Open a GitHub issue and then modify two test files. When running markit enter a message and include the GitHub issue number and GitHub will update the issue.
To Install, change into a directory that you want to download the scripts. Use git to pull or clone these scripts into the directory. If you do not have Git installed then enter; "sudo apt-get install git" if using Debian/Ubuntu. Other Linux distribution install methods can be found here: https://git-scm.com/download/linux. On the GitHub page of this script use the "HTTPS clone URL" with the 'git clone' command.
git clone https://github.com/BradleyA/markit
cd markit
Copy markit, check-markit, and find-code.sh to a directory that is included in your PATH (/usr/local/bin or ~/bin).
cp -p {./markit,./check-markit,./find-code.sh} /usr/local/bin
To install the latest commit of markit, change to the directory you want to download the script to (cd /usr/local/bin) and enter the follow command.
curl -L https://api.github.com/repos/BradleyA/markit/tarball | tar -xzf - --wildcards BradleyA-markit-*/markit ; mv BradleyA-markit-*/markit . ; rm -r BradleyA-markit-*
To install the latest commit of check-markit, change markit to check-markit in the above command.
Mark tracked modified file(s), in your local Git repository and push those changes to a remote Git repository. This example shows markit pushing to three remote Git repositories; GitHub, GitLab, and Bitbucket. Enter markit --help to see how .git/config was edited to support three repositories.
markit
Check the release version of a file with the remote Git repository release