more refactoring of revision control scripts
authorChris Koeritz <fred@gruntose.com>
Thu, 9 Nov 2017 17:25:44 +0000 (12:25 -0500)
committerChris Koeritz <fred@gruntose.com>
Thu, 9 Nov 2017 17:25:44 +0000 (12:25 -0500)
hopefully the last checkin

scripts/rev_control/compact_git.sh
scripts/rev_control/getem.sh
scripts/rev_control/push_repo_downstream.sh
scripts/rev_control/rcheckin.sh
scripts/rev_control/report_new.sh
scripts/rev_control/resolve_svn.sh
scripts/rev_control/rgetem.sh

index 8de72543f7ad3c969e597499ffed720e0a9e50bf..c1a22ef0b5c45d41cfcddd3764aa61ed88a97d5d 100644 (file)
@@ -2,16 +2,28 @@
 
 # compresses the git archive in the folder specified.
 
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
+
+##############
+
 prune_dir="$1"
 if [ -z "$prune_dir" ]; then
   prune_dir="$(pwd)"
 fi
-pushd "$prune_dir"
+pushd "$prune_dir" &>/dev/null
+test_or_die "changing to directory: $prune_dir"
+
 echo "cleaning git repo in directory $(pwd)"
+
 git fsck --full
 test_or_die "git fsck"
+
 git gc --prune=today --aggressive
 test_or_die "git gc"
+
 git repack
 test_or_die "git repack"
-popd
+
+popd &>/dev/null
+
index 3818b588f11ed69a7ab6139727239f62d7790c2a..e7aeabc6588407406ce7684d6bff079f1e0de716 100644 (file)
@@ -7,11 +7,12 @@ source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
 ##############
 
-# trickery to ensure we can always update this file, even when the operating system has some
-# rude behavior with regard to file locking (ahem, windows...).
-# and even more rudeness is that the pwd and $TMP may not always be in the same form,
-# which causes endless confusion and badness.  that's why we get the pwd reading for TMP
-# first so we can do an orange-to-orange compare.
+# trickery to ensure we can always update feisty meow, including this specific
+# file, even when the operating system has some rude behavior with regard to
+# file locking (ahem, windoze).  and even more rudeness is that the pwd and
+# $TMP may not always be in the same form, which causes endless confusion and
+# badness.  that's why we get the pwd reading for TMP first so we can do an
+# oranges-to-oranges compare.
 tmpdir="$(cd $TMP; \pwd)"
 if [ "$(\pwd)" != "$tmpdir" ]; then
   if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
@@ -20,11 +21,13 @@ if [ "$(\pwd)" != "$tmpdir" ]; then
   new_name="$TMP/zz_$(basename $0)"
   \cp -f "$0" "$new_name"
   test_or_die "failed to copy this script up to the TMP directory.  exploit attempted?"
-  cd "$TMP"
+  pushd "$TMP" &>/dev/null
+  test_or_die "changing to TMP directory: $TMP"
   chmod a+x "$new_name"
   test_or_die "chmodding of file: $new_name"
   exec "$new_name"
   test_or_die "execing cloned getemscript"
+  popd &>/dev/null
 fi
 
 ##############
index 2f4e3db1d2647e616632eb3d88d2053811e18e8b..84214b70a58b04f05423a029420ff76ef7c6e527 100644 (file)
 #
 # push_repo_downstream ~/relay_repo_folder
 
-#hmmm: make this support multiple dirs?
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
+
+##############
 
 dir="$1"; shift
 if [ -z "$dir" ]; then
   dir=.
 fi
 
-pushd "$dir"
+pushd "$dir" &>/dev/null
+test_or_die "changing to directory: $dir"
 
 # get everything from the origin.
 git fetch origin
@@ -50,6 +54,5 @@ unset GIT_SSH
 git push downstream master
 test_or_die "running the git push downstream"
 
-popd
-
+popd &>/dev/null
 
index 1c50d517776fe87aecbdc1a82b3f5145c3d6be13..1c5400fb8562105a439673c01efc0136652e8871 100644 (file)
@@ -14,10 +14,10 @@ if [ -z "$dir" ]; then
   dir=.
 fi
 
-
 pushd "$dir" &>/dev/null
 test_or_die "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
+test_or_die "generating revision control file list"
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_checkin
index 4da1a4a0025e0b73af59abd18e41bccee0cb404f..e51e90c79b2fe436045c7c2c25074aab21240060 100644 (file)
@@ -18,6 +18,7 @@ fi
 pushd "$dir" &>/dev/null
 test_or_die "changing directory to: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
+test_or_die "generating revision control file list"
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_report_new
index 3484a859915fd47a9fcd18e339b2693346c9b6d0..b75979738722604de485d217b321a6dc64104009 100644 (file)
@@ -3,8 +3,18 @@
 # resolves a tree conflict by accepting the "working" version,
 # which effectively makes your current change the accepted one.
 
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
+
+##############
+
 filename="$1"; shift
 
+if [ -z "$filename" ]; then
+  echo "This script needs a filename to operate on."
+  exit 1
+fi
+
 svn resolve --accept=working "$filename"
 test_or_die "resolving tree conflict by accepting the working directory as the right one"
 
index 37538b6b7f6393dda3fbcfd84137bc98919063de..4c29c03863912887cf0e7b356fa6c7fdec437856 100644 (file)
@@ -17,6 +17,7 @@ fi
 pushd "$dir" &>/dev/null
 test_or_die "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
+test_or_die "generating revision control file list"
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_update