Skip to content

Commit c38d172

Browse files
sync_git_repo_from_pc1_to_pc2.sh: update formatting to improve communication to user
1. Add double asterisks (** **) around the words "**staged**", "**not staged**", and "**untracked**" in the automatic `git commit` messages in order to make them stand out more. 2. Change "1st", "2nd", "3rd" words to "1/3", "2/3", and "3/3" to give the user a better indication of progress when updating the remote PC2 with the synchronized changes.
1 parent ff8a069 commit c38d172

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

useful_scripts/sync_git_repo_from_pc1_to_pc2.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ sync_pc1_to_remote_branch () {
186186
file_names_path="$FILES_STAGED"
187187
if [ "$num" -gt "0" ]; then
188188
if [ "$num" -eq "1" ]; then
189-
verbiage="1. This ${num} file was staged & is now committed:"
189+
verbiage="1. This ${num} file was **staged** & is now committed:"
190190
else
191-
verbiage="1. These ${num} files were staged & are now committed:"
191+
verbiage="1. These ${num} files were **staged** & are now committed:"
192192
fi
193193
commit_msg="$(printf "${commit_msg}\n\n${verbiage}")"
194194
file_names="$(cat "$file_names_path")"
@@ -200,9 +200,9 @@ sync_pc1_to_remote_branch () {
200200
file_names_path="$FILES_NOT_STAGED"
201201
if [ "$num" -gt "0" ]; then
202202
if [ "$num" -eq "1" ]; then
203-
verbiage="2. This ${num} file was changed but not staged & is now committed:"
203+
verbiage="2. This ${num} file was changed but **not staged** & is now committed:"
204204
else
205-
verbiage="2. These ${num} files were changed but not staged & are now committed:"
205+
verbiage="2. These ${num} files were changed but **not staged** & are now committed:"
206206
fi
207207
commit_msg="$(printf "${commit_msg}\n\n${verbiage}")"
208208
file_names="$(cat "$file_names_path")"
@@ -214,9 +214,9 @@ sync_pc1_to_remote_branch () {
214214
file_names_path="$FILES_UNTRACKED"
215215
if [ "$num" -gt "0" ]; then
216216
if [ "$num" -eq "1" ]; then
217-
verbiage="3. This ${num} file was untracked & is now committed:"
217+
verbiage="3. This ${num} file was **untracked** & is now committed:"
218218
else
219-
verbiage="3. These ${num} files were untracked & are now committed:"
219+
verbiage="3. These ${num} files were **untracked** & are now committed:"
220220
fi
221221
commit_msg="$(printf "${commit_msg}\n\n${verbiage}")"
222222
file_names="$(cat "$file_names_path")"
@@ -301,13 +301,13 @@ update_pc2 () {
301301
echo "ENSURE YOU HAVE YOUR PROPER SSH KEYS FOR GITHUB LOADED INTO YOUR SSH AGENT"
302302
echo " (w/'ssh-add <my_github_key>') OR ELSE THESE FOLLOWING STEPS WILL FAIL!"
303303
echo "Force pulling from remote \"$SYNC_BRANCH\" branch to overwrite local copy of this branch."
304-
echo " 1st: git fetch origin \"$SYNC_BRANCH\""
304+
echo " 1/3: git fetch origin \"$SYNC_BRANCH\""
305305
git fetch origin "$SYNC_BRANCH" # MAY NEED TO COMMENT OUT DURING TESTING
306-
echo " 2nd: git checkout \"$SYNC_BRANCH\""
306+
echo " 2/3: git checkout \"$SYNC_BRANCH\""
307307
# Note: this `git checkout` call automatically checks out this branch from the remote "origin" if this branch
308308
# is not already present locally
309309
git checkout "$SYNC_BRANCH" # MAY NEED TO COMMENT OUT DURING TESTING
310-
echo " 3rd: git reset --hard \"origin/$SYNC_BRANCH\" (to force-update the local branch to match the origin branch)"
310+
echo " 3/3: git reset --hard \"origin/$SYNC_BRANCH\" (to force-update the local branch to match the origin branch)"
311311
git reset --hard "origin/$SYNC_BRANCH" # MAY NEED TO COMMENT OUT DURING TESTING
312312

313313
echo "---\"update_pc2\" script end---"

0 commit comments

Comments
 (0)