GitLab system status is available here and here

Commit ea24f3ac authored by Anthony Umemoto's avatar Anthony Umemoto
Browse files

v1.2.0 testing

parent 07d737a0
# GITMANG v1.0.2
# GITMANG v1.2.0
gitmang can be downloaded off the gitLab web interface, or the gitmang master branch can be pulled using:
......@@ -12,7 +12,7 @@ A shell script for automated git repository management in the command line envir
## USAGE
`$ ./gitmang.sh [-hB] [-RdD dir] [-f freq] [-r reps] [file1 file2 ...]`
`$ ./gitmang.sh [-vsBh] [-dDR dir] [-b branch] [-f freq] [-r reps] [file1 file2 ...]`
git must be installed, and gitmang should be run in a UNIX or git bash terminal. gitmang is currently untested in other terminals such as the Windows command prompt, and the macOS terminal. To give executing permissions use:
......@@ -40,10 +40,16 @@ If the correct URL is returned, then the repair should work.
## OPTIONS
`-v` Display verbose program output.
`-s` Silence commit and push summaries.
`-d dir` The file path, from the current working directory, to the repository being managed.
`-D dir` The file path, from the main directory, to the repository being managed (recommended for UNIX only).
`-b branch` Begins gitmang in branch. Creates branch if it does not exist (default: master).
`-f freq` The time interval in minutes between each commit (default: 5).
`-r reps` The number of commits to be made before ending (defualt: 100).
......@@ -52,20 +58,30 @@ If the correct URL is returned, then the repair should work.
`-B` Keeps gm_repair_backup directory after repository repair. This can be used as a backup in case [-R dir] fails. gm_repair_backup is placed in the same directory the local repository is a child of.
`-h` Display program usage and synopsis.
`file1 file2 ...` File names that will be added to the commit list.
`file1 file2 ...` File names that will be added to the commit list.
`-h` Display program usage and synopsis.
## PROGRAM INPUT
`q` Quits the program.
`v` Toggle verbose program output.
`s` Toggle commit and push summaries.
`d dir` Changes the git repo being managed. The file path should be from the current working directory.
`f freq` Changes the interval between each commit.
`a file` Adds a single file to the commit list. To add another file, [a file] will need to be used again.
`r file` Removes a single file from the commit list.
`l` Displays the commit list.
`b branch` Moves to branch. Creates branch if it does not exist.
`h` Display program input options.
## OUTPUT
......
......@@ -2,6 +2,15 @@
Most recent version is listed first.
### v1.2.0 March 23, 2022 7:30PM PDT
+ Added branch switching with the [-b branch] option. The same can be done with the [b brach] input option to switch branches during runtime.
+ Verbose output can now be enabled with the [-v] option. Using the [v] input option toggles verbose output during runtime.
+ Commit and push summaries can now be silenced with [-s] option. Using the [s] input option toggles the summaries during runtime.
+ Added the [l] input option, which displays what files are currently in the commit list.
+ Added the [r file] input option, which removes the file name from the commit list.
+ Small documentation revisions.
### v1.0.2 March 18, 2022 7:30PM PDT
+ The total time is now correctly output when the program ends.
......
#!/bin/bash
function gm_options {
echo "INPUT OPTIONS"
echo " q Quits the program."
echo " v Toggle verbose program output."
echo " s Toggle commit and push summaries."
echo " d dir Changes the git repository being managed."
echo " The file path should be from the current working directory."
echo " f freq Changes the interval between each commit."
echo " a file Add a single file to the commit list."
echo " r file Removes a single file from the commit list."
echo " l Displays the commit list."
echo " b branch Moves to branch. Creates branch if it does not exist."
echo " h Display program input options."
}
function gm_usage {
echo "GITMANG.SH HELP:"
echo "GITMANG.SH HELP: For more usage information, view the README."
echo ""
echo "SYNOPSIS"
echo " A shell script that commits specified files at a regular interval."
echo ""
echo "USAGE"
echo " $ ./gitmang.sh [-hB] [-RdD dir] [-f freq] [-r reps] [file1 file2 ...]"
echo " $ ./gitmang.sh [-vsBh] [-dDR dir] [-b branch] [-f freq] [-r reps] [file1 file2 ...]"
echo ""
echo "OPTIONS"
echo " -d dir The file path, from the current working directory, to the repo being managed."
echo " -v Display verbose program output."
echo " -s Silence commit and push summaries."
echo " -d dir The file path, from the current working directory, to the repository being managed."
echo " -D dir The file path, from the main directory, to the repository being managed."
echo " -b branch Begins gitmang in branch. Creates branch if it does not exist (default: master)."
echo " -f freq The time interval in minutes between each commit (default: 5)."
echo " -r reps The number of commits to be made before ending (default: 100)."
echo " -R dir Repairs the corrupted repository dir, saving un-committed files."
echo " Path is from working directory."
echo " -B Keeps gm_repair_backup directory after repository repair."
echo " This can be used as a backup in case [-R dir] fails."
echo " -h Display program synopsis and usage."
echo " file1 ... File names that will be added to the commit list."
echo " -h Display program synopsis and usage."
echo ""
echo "PROGRAM INPUT"
echo " q Quits the program."
echo " d dir Changes the git repo being managed."
echo " The file path should be from the current working directory."
echo " f freq Changes the interval between each commit."
echo " a file Adds a single file to the commit list."
echo " To add another file, [a file] will need to be used again."
echo " h Display program input options."
echo ""
echo "For more usage information, view the README."
gm_options # input options
echo ""
echo "OUTPUT"
echo " Prints to stdout: <reps> commit(s) completed over <total time> minute(s)"
......@@ -39,32 +48,25 @@ function gm_usage {
echo " Anthony Umemoto 2022, with debugging assistance from Omar Ahmadyar."
}
function gm_options {
echo "INPUT OPTIONS"
echo " q Quits the program."
echo " d dir Changes the git repo being managed."
echo " The file path should be from the current working directory."
echo " f freq Changes the interval between each commit."
echo " a file Add a single file to the commit list."
echo " To add aother file, [a file] will need to be used again."
echo " h Display program input options."
echo ""
}
# all vars are prepended with "gm_" to avoid overriding other global vars
# default options
gm_dir=""
gm_branch="master"
gm_main=0
gm_freq=5
gm_reps=100
gm_repair=0
gm_backup=0
gm_files=()
gm_verb=0
gm_sil=""
# process command line arguments
while getopts d:D:f:r:R:Bh opt; do
while getopts vsd:D:bf:r:R:Bh opt; do
case "${opt}" in
v) gm_verb=1;;
s) gm_sil="-q";;
d) gm_dir=${OPTARG};;
D)
gm_dir=${OPTARG}
......@@ -188,8 +190,8 @@ while (( $gm_reps > 0 )); do
for gm_ft in "${gm_files[@]}"; do
git add $gm_ft
done
git commit -m "autosaving progress $(date)"
git push
git commit $gm_sil -m "autosaving progress $(date)"
git push $gm_sil
trap - SIGINT
# tracking progress
......@@ -198,6 +200,13 @@ while (( $gm_reps > 0 )); do
# nice formatting
echo "--------------------------------------------------"
# verbose output
if (( $gm_verb == 1 )); then
echo "$gm_sreps commit(s) made in $(basename $(pwd)) on $gm_branch branch."
echo "Current program runtime: $(( $(( $(date "+%s") - $gm_stime )) / 60 )) min(s)."
echo ""
fi
# program input
if (( $gm_reps > 0 )); then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment