From 73238c38222e5e578ec3621c6d7a1a15e1e67594 Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Wed, 8 Jan 2025 23:59:16 -0500 Subject: [PATCH] cleaning approach some more for seeking .git dir --- scripts/rev_control/compact_git.sh | 2 +- scripts/rev_control/getem.sh | 8 ++++---- scripts/rev_control/version_control.sh | 16 ++++++++++------ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/rev_control/compact_git.sh b/scripts/rev_control/compact_git.sh index ed9ed167..ce2be238 100644 --- a/scripts/rev_control/compact_git.sh +++ b/scripts/rev_control/compact_git.sh @@ -16,7 +16,7 @@ fi pushd "$prune_dir" &>/dev/null exit_on_error "changing to directory: $prune_dir" -echo "cleaning git repo in directory $(pwd)" +echo "cleaning git repo in directory '$prune_dir'" git fsck --full exit_on_error "git fsck" diff --git a/scripts/rev_control/getem.sh b/scripts/rev_control/getem.sh index de908230..72b333cf 100644 --- a/scripts/rev_control/getem.sh +++ b/scripts/rev_control/getem.sh @@ -11,10 +11,10 @@ save_terminal_title # 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. +# file locking (ahem, windoze). and even more rudeness is that the 'pwd' +# output 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 diff --git a/scripts/rev_control/version_control.sh b/scripts/rev_control/version_control.sh index bf96c542..2c4934f3 100644 --- a/scripts/rev_control/version_control.sh +++ b/scripts/rev_control/version_control.sh @@ -15,13 +15,16 @@ source "$FEISTY_MEOW_SCRIPTS/tty/terminal_titler.sh" export MAX_DEPTH=5 # the name of our "don't check this stuff in" file. +#hmmm: name this better for the variable name, like FEISTY_MEOW_REV_CONTROL_NO_CHECKIN_FILENAME or something. export NO_CHECKIN=".no-checkin" +#hmmm: move to a global repository of variables perhaps? # use our splitter tool for lengthy output if it's available. if [ ! -z "$(whichable splitter)" ]; then TO_SPLITTER="$(whichable splitter)" - # calculate the number of columsn in the terminal. + # calculate the number of columns in the terminal. cols=$(get_maxcols) +#hmmm: can the get_maxcols throw any errors, such that it gives a bad value? TO_SPLITTER+=" --maxcol $(($cols - 1))" else TO_SPLITTER=cat @@ -52,24 +55,24 @@ fi ############## -# does a revision control check-in for the directory provided. -# this uses the currently configured repository as the target for storage. +# performs a generalized revision control check-in operation for the directory provided. +# this uses the directory's currently configured repository and branch as the target for storage. function do_revctrl_checkin() { local directory="$1"; shift - -#hmmm: another piece of reusable code, to process the directory for printing. +#hmmm: abstract reusable code below that processes the directory name for printing. # make a nice echoer since we want to use it inside conditions below. local nicedir="$directory" if [ $nicedir == "." ]; then nicedir="$( \cd . && /bin/pwd )" #echo "calculated nicedir as '$nicedir'" fi + + # prepare some reporting variables ahead of time. local blatt_report="echo -ne \nchecking in '$nicedir'... " local tell_no_checkin="echo -ne \nskipping check-in due to presence of $NO_CHECKIN sentinel file: $nicedir" pushd "$directory" &>/dev/null -#hmmm: overly elaborate sections below here, but we do want precise handling for git case. if [ -d "CVS" ]; then if test_writeable "CVS"; then do_revctrl_simple_update "$directory" @@ -100,6 +103,7 @@ function do_revctrl_checkin() #-d ".git" ]; then echo into git case. topdir="$(seek_writeable ".git" "up")" +echo "got topdir from seeking of '$topdir'" if [ ! -z "$topdir" ]; then # take steps to make sure the branch integrity is good and we're up to date against remote repos. -- 2.34.1