GitLab system status is available here and here

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

v1.3.0 doc

parent c961c7e4
......@@ -15,6 +15,8 @@ A shell script for automated git repository management in the command line envir
## PROGRAM FILES
+ gitmang.sh: The shell script for automating git repository management.
+ create_preset.sh: The shell script used for creating new presets.
+ gm_usage.sh: Contains usage statements for gitmang programs.
+ presets.gm: Contains created presets.
+ UPDATE.md: Lists each version of gitmang, and what changes were made.
+ README.md: Explains how to use gitmang.
......@@ -33,21 +35,15 @@ gitmang requires that a terminal window is dedicated to running it. Open a new t
Or open a new git bash window in your gitmang local repository.
When quitting the program, use the 'q' runtime option to quit properly. Always remember to quit properly before turning off your machine. If gitmang is unexpectedly ended while it is performing a commit, the local repository may become corrupt. If this happens, delete the repository directory with:
`$ rm -rf <dir>`
and re-clone it with:
`$ git clone <repo URL> <dir>`
Alternatively, use the [-R dir] command to repair the local repository to save un-committed work. However, this command only works if the remote repository URL is uncorrupted. To test if it is, use:
When quitting the program, use the 'q' runtime option to quit properly. Always remember to quit properly before turning off your machine. If gitmang is unexpectedly ended while it is performing a commit, the local repository may become corrupt. If this happens, use the [-R dir] command to repair the local repository to save un-committed work. However, this command only works if the remote repository URL is uncorrupted. To test if it is, use:
`$ git config --get remote.origin.url`
If the correct URL is returned, then the repair should work.
## OPTIONS
## COMMAND LINE OPTIONS
### GITMANG.SH
`-v` Display verbose program output.
......@@ -73,6 +69,26 @@ If the correct URL is returned, then the repair should work.
`-h` Display program usage and synopsis.
### CREATE_PRESET.SH
`./create_preset.sh [-h] [-p preset] [-o outfile]`
`-p preset` The name of the preset to be made.
`-o outfile` Specify an outfile to output the creaed preset to besides presets.gm. If no outfile is specified, output to stdout.
`-h` Display program usage and synopsis.
### GM_USAGE.SH
`./gm_usage.sh [-hrp]`
`-h` Only display gitmang command line options.
`-r` Only display gitmang runtime options.
`-p` Display create_preset.sh synopsis and usage.
## RUNTIME OPTIONS
`q` Quits the program.
......
......@@ -9,6 +9,8 @@ Most recent version is listed first.
+ If the preset name is already defined, then it gitmang will begin running using that preset. If the preset name is new, then a new preset will be created. If no preset name is specified, then the list of saved presets will be displayed.
+ Added the [-x preset] command line option to delete to specified preset.
+ Added the presets.gm file, which contains all created presets. This file can be editted directly.
+ Added the gm_usage.sh script, which contains all usage messages for gitmang programs.
+ Added the create_preset.sh script, which is used to create presets. Users can use this script, or the [-p preset] command line option to create a new preset.
+ Minor documentation revisions.
### v1.2.1 March 24, 2022, 6:50 PDT
......
#!/bin/bash
\ No newline at end of file
#!/bin/bash
# USAGE MESSAGES ---------------------------------------------------------
function gm_options {
echo "RUNTIME OPTIONS"
echo " q Quits the program."
echo " c Immediately perform a commit."
echo " t Display the time remaining until the next commit."
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 " b branch Moves to branch. Creates branch if it does not exist."
echo " If no branch is specified, then the branch list will be printed."
echo " f freq Changes the interval between each commit."
echo " If no freq is specified, then the current interval will be displayed."
echo " a file Add a file name to the commit list."
echo " r file Remove a file name from the commit list."
echo " l Display the commit list."
echo " h Display program runtime options."
}
function gm_usage {
echo "GITMANG.SH SYNOPSIS: For more usage information, view the README."
echo " A shell script that commits specified files at a regular interval."
echo ""
echo "USAGE"
echo " $ ./gitmang.sh [-vsBh] [-p preset] [-dDR dir] [-b branch] [-f freq] [-r reps] [file1 file2 ...]"
echo ""
echo "OPTIONS"
echo " -v Display verbose program output."
echo " -s Silence commit and push summaries."
echo " -p preset Use preset gitmang options."
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 " file1 ... File names that will be added to the commit list."
echo " -h Display program synopsis and usage."
echo ""
echo "OUTPUT"
echo " Prints to stdout: <reps> commit(s) completed over <total time> minute(s)"
echo ""
echo "AUTHOR"
echo " Anthony Umemoto 2022, with debugging assistance from Omar Ahmadyar."
}
# COMMAND LINE ARGUMENTS -------------------------------------------------
# all vars are prepended with "gm_" to avoid overriding other global vars
......@@ -68,12 +17,45 @@ gm_backup=0
gm_files=()
# process command line arguments
while getopts vsd:D:b:f:r:R:Bh opt; do
while getopts vsp:d:D:b:f:r:R:Bh opt; do
case "${opt}" in
v) gm_verb=1;; # verbose output
s) gm_sil="-q";; # silence summaries
p) # presets
if [[ ${OPTARG} == "" ]]; then # display all presets
echo "Available presets:"
while read -r line < presets.gm; do
echo "$line"
done
else
# look for preset
while read -r -a gm_preset < presets.gm; do
if [[ ${gm_preset[0]} == ${OPTARG} ]]; then
gm_i=0 # iterator so that
for gm_preopt in "${gm_preset[@]}"; do
case "gm_preopt" in
"-v") gm_verb=1;;
"-s") gm_sil=1;;
"-d") gm_dir=${gm_preset[$((gm_i+1))]};;
"-D") gm_dir=${gm_preset[$((gm_i+1))]};;
"-b") gm_branch=${gm_preset[$((gm_i+1))]};;
"-f") gm_freq=${gm_preset[$((gm_i+1))]};;
"-r") gm_reps=${gm_preset[$((gm_i+1))]};;
*) gm_files+=(gm_preopt);;
esac
((gm_i+=1))
done
fi
done
if [[ $gm_dir == "" ]]; then
./create_preset.sh
exit
fi
fi;;
d) gm_dir=${OPTARG};; # repo directory from working dir
D) # repo directory from main dir
......@@ -104,10 +86,10 @@ while getopts vsd:D:b:f:r:R:Bh opt; do
B) gm_backup=1;; # keep backup
h) # program usage and synopsis
gm_usage
./gm_usage.sh -h
exit;;
*)
gm_usage
./gm_usage.sh -h
exit;;
esac
done
......@@ -395,7 +377,7 @@ while (( $gm_reps > 0 )); do
echo "Current file names in the commit list:"
echo "${gm_files[*]}";;
h) gm_options;; # runtime options
h) ./gm_usage.sh -r;; # runtime options
*) echo "Failed to execute runtime command.";;
esac
......
#!/bin/bash
function gm_rto {
echo "RUNTIME OPTIONS"
echo " q Quits the program."
echo " c Immediately perform a commit."
echo " t Display the time remaining until the next commit."
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 " b branch Moves to branch. Creates branch if it does not exist."
echo " If no branch is specified, then the branch list will be printed."
echo " f freq Changes the interval between each commit."
echo " If no freq is specified, then the current interval will be displayed."
echo " a file Add a file name to the commit list."
echo " r file Remove a file name from the commit list."
echo " l Display the commit list."
echo " h Display program runtime options."
}
function gm_clo {
echo "COMMAND LINE OPTIONS"
echo " -v Display verbose program output."
echo " -s Silence commit and push summaries."
echo " -p preset Use preset gitmang options."
echo " -x preset Delete the specified preset."
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 " file1 ... File names that will be added to the commit list."
echo " -h Display program usage and synopsis."
}
function gm_usage {
echo "GITMANG.SH SYNOPSIS: For more usage information, view the README."
echo " A shell script that commits specified files at a regular interval."
echo ""
echo "USAGE"
echo " $ ./gitmang.sh [-vsBh] [-p preset] [-dDR dir] [-b branch] [-f freq] [-r reps] [file1 file2 ...]"
echo ""
gm_clo
echo ""
echo "OUTPUT"
echo " Prints to stdout: <reps> commit(s) completed over <total time> minute(s)"
echo ""
echo "AUTHOR"
echo " Anthony Umemoto 2022, with debugging assistance from Omar Ahmadyar."
}
function gm_complete {
echo "GITMANG.SH SYNOPSIS: For more usage information, view the README."
echo " A shell script that commits specified files at a regular interval."
echo ""
echo "USAGE"
echo " $ ./gitmang.sh [-vsBh] [-p preset] [-dDR dir] [-b branch] [-f freq] [-r reps] [file1 file2 ...]"
echo ""
gm_clo
echo ""
gm_rto
echo ""
echo "OUTPUT"
echo " Prints to stdout: <reps> commit(s) completed over <total time> minute(s)"
echo ""
echo "AUTHOR"
echo " Anthony Umemoto 2022, with debugging assistance from Omar Ahmadyar."
}
function gm_preset {
echo "CREATE_PRESET.SH SYNOPSIS: For more usage information, view the README."
echo " A shell script that creates option presets for gitmang. Presets are stored in presets.gm."
echo ""
echo "USAGE"
echo " $ ./create_preset.sh [-h] [-p preset] [-o outfile]"
echo ""
echo "OPTIONS"
echo " -p preset Specify the name of the preset to be made."
echo " -o outfile Specify an outfile to output the creaed preset to besides presets.gm."
echo " If no outfile is specified, output to stdout."
echo " -h Display program usage and synopsis."
echo ""
echo "AUTHOR"
echo " Anthony Umemoto 2022"
}
# process command line arguments
while getopts hrp opt; do
case "${opt}" in
h)
gm_usage
exit;;
r)
gm_rto
exit;;
p)
gm_preset
exit;;
*)
gm_complete
exit;;
esac
done
\ No newline at end of file
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